Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-eol-enforce with all npm packages installed. Try it out:

var gulpEolEnforce = require("gulp-eol-enforce")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-eol-enforce v1.0.0

Enforces proper line endings for files

gulp-eol-enforce

status npm version dependencies license downloads

Checks line endings to ensure they're the proper type. This plugin will fail if undesired line endings are found. Particularly useful as a pre-commit hook.

Usage

eol(desiredNewLine)

desiredNewLine can be one of the following strings:

  • "\n"
  • "\r\n"
  • "\r"

This parameter defaults to your platform's default line ending (os.EOL).

Use this in your Gulpfile.js like so:

var eol = require('gulp-eol-enforce');

gulp.task('eol', function () {
  return gulp.src(['src/**/*.{css,js}'])
    .pipe(eol('\n'));
});

Example output:

Automatic Correction

This plugin does not automatically fix line endings - use gulp-eol or gulp-line-ending-corrector instead.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free