Détail du package

grunt-endline

hex7c0225GPL-3.00.7.0

add newline at end of file

gruntplugin, endline, newline, EOF

readme

grunt-endline

NPM version Linux Status Dependency Status

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.loadNpmTasks('grunt-endline');

The "endline" task

Overview

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

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

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.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.

grunt.initConfig({
    custom_options: {
        options: {
            footer: 5
        },
        files: {
            'tmp/multiple': [ 'test/target/*' ]
        }
    }
});

License GPLv3

changelog

v0.7.0 / 2017-12-30

  • Tested against node@9

v0.6.2 / 2017-02-09

  • Tested against node@7
  • Remove support for node@0

v0.6.1 / 2016-09-18

  • Fix "edited" counter

v0.6.0 / 2016-09-18

  • Async flow
  • Move grunt to devDependencies

v0.5.1 / 2016-09-12

  • Tested against node@6

v0.5.0 / 2016-04-10

  • Update grunt@^1.0.0
  • Tested against node@5.7

v0.4.1 / 2015-11-20

  • Tested against node@5

v0.4.0 / 2015-09-22

  • Fix peerDependencies as dependencies
  • Tested against node@4

v0.3.0 / 2015-07-20

  • fix empty files

v0.2.5 / 2015-02-18

  • iojs test

v0.2.4 / 2014-10-07

  • "replaced" (options)

v0.2.3 / 2014-10-04

  • Remove jsdoc
  • package.json min

v0.2.2 / 2014-09-05

  • Fix "except" function

v0.2.1 / 2014-09-01

  • Fix "except" when is Array

v0.2.0 / 2014-09-01

  • Add "except" (options)

v0.1.0 / 2014-09-01

  • Operative

v0.0.1 / 2014-09-01

  • Project start