Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

detect-newline

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Issues
File Explorer

Advanced tools

detect-newline

Detect the dominant newline character of a string

    4.0.0latest

Version published
Maintainers
1
Weekly downloads
17,723,050
increased by1.42%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12.20 5539419
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/detect-newline/compare/v3.1.0...v4.0.0

Readme

Source

detect-newline

Detect the dominant newline character of a string

Install

npm install detect-newline

Usage

import {detectNewline} from 'detect-newline'; detectNewline('foo\nbar\nbaz\r\n'); //=> '\n'

API

detectNewline(string)

Returns the detected newline or undefined when no newline character is found.

detectNewlineGraceful(unknown)

Returns the detected newline or \n when no newline character is found or the input is not a string.

Keywords

FAQs

What is detect-newline?

Detect the dominant newline character of a string

Is detect-newline popular?

The npm package detect-newline receives a total of 15,438,850 weekly downloads. As such, detect-newline popularity was classified as popular.

Is detect-newline well maintained?

We found that detect-newline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 14 Oct 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc