https://github.com/colinodell/gulp-eol-enforce
Checks whether files have the correct line endings
https://github.com/colinodell/gulp-eol-enforce
crlf eol gulp gulp-plugin lf line-endings
Last synced: about 1 month ago
JSON representation
Checks whether files have the correct line endings
- Host: GitHub
- URL: https://github.com/colinodell/gulp-eol-enforce
- Owner: colinodell
- License: mit
- Created: 2015-12-02T19:06:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T16:26:00.000Z (over 6 years ago)
- Last Synced: 2025-03-14T16:17:23.550Z (2 months ago)
- Topics: crlf, eol, gulp, gulp-plugin, lf, line-endings
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-eol-enforce
[](https://travis-ci.org/colinodell/gulp-eol-enforce)
[](https://www.npmjs.com/package/gulp-eol-enforce)

[](LICENSE)
[](https://www.npmjs.com/package/gulp-eol-enforce)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
```js
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:
```js
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](https://www.npmjs.com/package/gulp-eol) or [gulp-line-ending-corrector](https://www.npmjs.com/package/gulp-line-ending-corrector) instead.