</>PackageGraphPackageGraph

detect-newline

npmv4.0.1TypeScript

Detect the dominant newline character of a string

Adopt with care

detect-newline is usable, with caveats. Last published 1083 days ago.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • DMaintenance: grade D, Poor — a real concern.

    Last published 1083 days ago.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 3.9 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding detect-newline to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

3.9 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node ^12.20.0 || ^14.13.1 || >=16.0.0
Module format
ESM only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the detect-newline README.

import {detectNewline} from 'detect-newline';

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

detect-newline vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
detect-newlinethis page01MIT3 years ago
word-wrap93.2M1MIT1 day ago
locate-character01MIT1 day ago
index-to-position01MIT1 day ago
callsites136.7M1MIT1 day ago
indent-string94M2MIT1 day ago

Dependencies

Declared by detect-newline v4.0.1. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (3)

ava ^3.15.0tsd ^0.18.0xo ^0.45.0

Used by

Popular packages that depend on detect-newline.

Relationship graph

Dependencies (left) and dependents (right) of detect-newline.

jest-docblockdetect-newline
detect-newline dependencies dependents

Frequently installed together

Release history

No releases in the last two years, typically about 160 days apart.

Recent versions of detect-newline
VersionPublishedSizeLicense
4.0.1latest3 years ago3.9 KBMIT
4.0.04 years ago3.7 KBMIT
3.1.06 years ago3.7 KBMIT
3.0.07 years ago3.6 KBMIT
2.1.010 years agoMIT
2.0.110 years agoMIT
2.0.010 years agoMIT
1.0.311 years agoMIT
1.0.211 years agoMIT
1.0.112 years agoMIT
1.0.012 years agoMIT
0.1.112 years agoMIT
0.1.012 years agoMIT

Overview

detect-newline is an npm package that detect the dominant newline character of a string. It has 1 known dependents in the graph. The latest version is 4.0.1, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need detect the dominant newline character of a string and value a focused solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).
  • Lean dependency tree (3 direct dependencies).

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Funding

Frequently asked questions

Should I use detect-newline?

detect-newline is usable, with caveats. Last published 1083 days ago.

How do I install detect-newline?

Run `npm install detect-newline` to add detect-newline to your npm project.

What license is detect-newline released under?

detect-newline is distributed under the MIT license.

How popular is detect-newline?

npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on detect-newline.

Is detect-newline still maintained?

The most recent release of detect-newline (v4.0.1) was published 3 years ago.

Does detect-newline run install scripts?

No. detect-newline does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.