normalize-newline
Normalize the newline characters in a string to `\n`
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install normalize-newline 
SYNC missed versions from official npm registry.

normalize-newline

Normalize the newline characters in a string to \n

Install

$ npm install normalize-newline

Usage

import normalizeNewline from 'normalize-newline';

normalizeNewline('foo\r\nbar\nbaz');
//=> 'foo\nbar\nbaz'

normalizeNewline(Buffer.from('foo\r\nbar\nbaz')).toString();
//=> 'foo\nbar\nbaz'

API

normalizeNewline(input)

input

Type: string | Buffer

Input to normalize.

Related

Current Tags

  • 4.1.0                                ...           latest (5 years ago)

9 Versions

  • 4.1.0                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           10 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |