normalize-newline

4.1.0last stable release 4 years ago
Complexity Score
Low
Open Issues
1
Dependent Projects
205
Weekly Downloadsglobal
64,203

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

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

  • normalize-newline-cli - CLI for this module

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
4.20
Test Coverage
No Data
Follows Semver
Yes
Github Stars
30
Dependenciestotal
4
DependenciesOutdated
3
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute normalize-newline in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install normalize-newline
Processing...
Done

9 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.