grunt-endline
Add newline at end of file if missing
Getting Started
This plugin requires Grunt ^1.0.0
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-endline --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "endline" task
Overview
In your project's Gruntfile, add a section named endline
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.footer
Type: String | Number
Default value: \n
Write newline at the end of file.
If is set a Number, replace footer
X times.
options.src
Type: String | Array
Source path
options.dest
Type: String | Array
Default value: false
Destination path.
options.except
Type: String | Array
Default value: false
Except path from parsing. Can hide "node_modules" from here.
options.replaced
Type: Boolean
Default value: false
Show file replaced.
Usage Examples
Default Options
In this example, the default options are used.
grunt;
Custom Options
In this example, custom options are used to do save 5 newlines.
grunt;