npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

normalize-newline

3.0.0 • Public • Published

normalize-newline Build Status

Normalize the newline characters in a string to \n

Install

$ npm install --save normalize-newline

Usage

const normalizeNewline = require('normalize-newline');
 
normalizeNewline('foo\r\nbar\nbaz');
//=> 'foo\nbar\nbaz'
 
normalizeNewline(new Buffer('foo\r\nbar\nbaz')).toString();
//=> 'foo\nbar\nbaz'

API

normalizeNewline(input)

input

Type: string Buffer

Input to normalize.

Related

License

MIT © Sindre Sorhus

install

npm i normalize-newline

Downloadsweekly downloads

24,730

version

3.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability