Skip to content

Gulp plugin that unifying newline characters to either \n, \r\n, or \r.

License

Notifications You must be signed in to change notification settings

takenspc/gulp-convert-newline

Repository files navigation

gulp-convert-newline

Build Status Build status Coverage Status Code Climate

Gulp plugin that unifying newline characters to either \n,\r\n, or \r.

Usage

"use strict";
var gulp = require("gulp");
var convertNewline = require("gulp-convert-newline");

gulp.task("default", function() {
	return gulp.src("src/file.txt")
		.pipe(convertNewline({
			newline: "crlf",
			encoding: "shift_jis"
		}))
		.pipe(gulp.dest("dest"));
});

API

convertNewline(options)

options

newline

Optional. Target newline characters. Either "lf", "crlf", or "cr". The default is "lf".

encoding

Optional. The encoding of the file. If encoding is not specified, utf8 encoding is assumed.

Supported encodings are listed on the iconv-lite wiki.

Thanks

This plugin is heavily based on gulp-convert-encoding.

About

Gulp plugin that unifying newline characters to either \n, \r\n, or \r.

Resources

License

Stars

Watchers

Forks

Packages

No packages published