split-on-first
npmv4.0.0TypeScriptSplit 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
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', '+');
//=> []
split-on-first vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| split-on-firstthis page | 9.7M | 1 | MIT | 1 year ago |
| camelcase | 95.7M | 2 | MIT | 1 day ago |
| indent-string | 94M | 2 | MIT | 1 day ago |
| normalize-path | 72.6M | 1 | MIT | 1 day ago |
| get-east-asian-width | 69.3M | 1 | MIT | 1 day ago |
| decamelize | 62.6M | 4 | MIT | 1 day ago |
Dependencies
Declared by split-on-first v4.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (3)
Used by
Popular packages that depend on split-on-first.
Relationship graph
Dependencies (left) and dependents (right) of split-on-first.
Frequently installed together
Release history
1 release in the last two years, typically about 204 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 4.0.0latest | 1 year ago | 4.5 KB | MIT |
| 3.0.0 | 5 years ago | 3.7 KB | MIT |
| 2.0.1 | 5 years ago | 3.7 KB | MIT |
| 2.0.0 | 6 years ago | 3.7 KB | MIT |
| 1.1.0 | 7 years ago | 3.7 KB | MIT |
| 1.0.0 | 7 years ago | 3.2 KB | MIT |
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
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.