grunt-surround

Surround the content of a file with another content.

grunt-surround

Surround the content of a file with another content.

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-surround --save-dev

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-surround');

In your project's Gruntfile, add a section named surround to the data object passed into grunt.initConfig().

grunt.initConfig({
  surround: {
    options: {
      // Task-specific options go here. 
    },
    your_target: {
      // Target-specific file lists and/or options go here. 
    },
  },
})

Type: String Default value: '' (empty String)

A string value that is prepended to the content.

Type: String Default value: '' (empty String)

A string value that is appended to the content.

Type: Boolean Default value: false

Set this option to true to overwrite the source file instead of the destination file. Note: If you set this option to true, there is no need to specify a destination file.

Type: String Default value: grunt.util.linefeed

The value for the linefeed.

Type: Boolean Default value: false

Set this option to true to check if your content already starts or ends with the specified 'prepend' or 'append' option. If a match is found, your content will not be modified to avoid repetitions.

grunt.initConfig({
  wraps: {
    options: {
      prepend: ';(function() {',
      append: '})()'
    },
    files: [{
      src: 'src/source.js',
      dest: 'dest/destination.js'
    }]
  }
})

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

(Nothing yet)