Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

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

30,901

Version

3.0.0

License

MIT

Last publish

Collaborators

  • avatar