detect-newline

WebJar for detect-newline

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

detect-newline
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

detect-newline
WebJar for detect-newline
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/detect-newline

Download detect-newline

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/detect-newline/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>detect-newline</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/detect-newline/
implementation 'org.webjars.npm:detect-newline:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/detect-newline/
implementation ("org.webjars.npm:detect-newline:2.1.0")
'org.webjars.npm:detect-newline:jar:2.1.0'
<dependency org="org.webjars.npm" name="detect-newline" rev="2.1.0">
  <artifact name="detect-newline" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='detect-newline', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "detect-newline" % "2.1.0"
[org.webjars.npm/detect-newline "2.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

detect-newline

Detect the dominant newline character of a string

Install

$ npm install detect-newline

Usage

const detectNewline = require('detect-newline');

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

API

detectNewline(string)

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

detectNewline.graceful(unknown)

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

Related

License

MIT © Sindre Sorhus

Versions

Version
2.1.0