npm install grunt-endline


> Add newline at end of file if missing
^1.0.0If 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:
``shell`
npm install grunt-endline --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-endline');
to the data object passed into grunt.initConfig().`js
grunt.initConfig({
endline: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
}
}
});
`$3
#### options.footer
Type:
String | Number
Default value: \nWrite newline at the end of file.
If is set a Number, replace
footer X times.#### options.src
Type:
String | ArraySource path
#### options.dest
Type:
String | Array
Default value: falseDestination path.
#### options.except
Type:
String | Array
Default value: falseExcept path from parsing.
Can hide "node_modules" from here.
#### options.replaced
Type:
Boolean
Default value: falseShow file replaced.
$3
#### Default Options
In this example, the default options are used.
`js
grunt.initConfig({
endline: {
default_options: {
files: [ {
src: 'test/target/with',
dest: 'tmp/object'
}, {
src: 'test/target/without',
dest: 'tmp/object'
} ]
}
},
});`#### Custom Options
In this example, custom options are used to do save 5 newlines.
`js
grunt.initConfig({
custom_options: {
options: {
footer: 5
},
files: {
'tmp/multiple': [ 'test/target/*' ]
}
}
});
``