</>PackageGraphPackageGraph

split-on-first

npmv4.0.0TypeScript

Split a string on the first occurance of a given separator

Adopt with care

split-on-first is usable, with caveats. Last published 385 days ago.

  • AAdoption: grade A, Excellent.

    9.7M downloads per week and 1 known dependents.

  • CMaintenance: grade C, Fair — worth a look.

    Last published 385 days ago.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 4.5 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 split-on-first 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.

4.5 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 >=20
Module format
ESM only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the split-on-first README.

import splitOnFirst from 'split-on-first';

splitOnFirst('a-b-c', '-');
//=> ['a', 'b-c']

splitOnFirst('key:value:value2', ':');
//=> ['key', 'value:value2']

splitOnFirst('a---b---c', '---');
//=> ['a', 'b---c']

splitOnFirst('a-b-c', '+');
//=> []
Example truncated — see the full README.

split-on-first vs the alternatives

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

PackageWeekly downloadsDependentsLicenseLast release
split-on-firstthis page9.7M1MIT1 year ago
camelcase95.7M2MIT1 day ago
indent-string94M2MIT1 day ago
normalize-path72.6M1MIT1 day ago
get-east-asian-width69.3M1MIT1 day ago
decamelize62.6M4MIT1 day ago

Dependencies

Declared by split-on-first v4.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (3)

ava ^6.4.1tsd ^0.33.0xo ^1.2.2

Used by

Popular packages that depend on split-on-first.

Relationship graph

Dependencies (left) and dependents (right) of split-on-first.

query-stringsplit-on-first
split-on-first dependencies dependents

Frequently installed together

Release history

1 release in the last two years, typically about 204 days apart.

Recent versions of split-on-first
VersionPublishedSizeLicense
4.0.0latest1 year ago4.5 KBMIT
3.0.05 years ago3.7 KBMIT
2.0.15 years ago3.7 KBMIT
2.0.06 years ago3.7 KBMIT
1.1.07 years ago3.7 KBMIT
1.0.07 years ago3.2 KBMIT

Overview

split-on-first is an npm package that split a string on the first occurance of a given separator. It is extremely widely used, with about 9.7M downloads per week and 1 known dependents in the graph. The latest version is 4.0.0, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need split a string on the first occurance of a given separator and value a battle-tested, widely-adopted 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

  • Large, well-established user base (9.7M weekly downloads).
  • 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 split-on-first?

split-on-first is usable, with caveats. Last published 385 days ago.

How do I install split-on-first?

Run `npm install split-on-first` to add split-on-first to your npm project.

What license is split-on-first released under?

split-on-first is distributed under the MIT license.

How popular is split-on-first?

split-on-first has approximately 9,685,634 downloads per week and 1 known dependent packages.

Is split-on-first still maintained?

The most recent release of split-on-first (v4.0.0) was published 1 year ago.

Does split-on-first run install scripts?

No. split-on-first does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.