{"name":"split-on-first","version":"4.0.0","description":"Split a string on the first occurance of a given separator","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/split-on-first.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["split","string","first","once","occurrence","separator","delimiter","text"],"devDependencies":{"ava":"^6.4.1","tsd":"^0.33.0","xo":"^1.2.2"},"_id":"split-on-first@4.0.0","gitHead":"7ef74ece990d3f424bb1128daf44b5a49202b290","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/split-on-first/issues"},"homepage":"https://github.com/sindresorhus/split-on-first#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-pyrgNqiEBHA9KlEtg9quYGagtrlTyukL3ryQ+RmjRn9SYmcNQmfa+sWIsI+hlcL4WrmFdrt7IfM6o8ktBAooDQ==","shasum":"f49436d62be0d529cef522e2fd4bd08725de2ff3","tarball":"http://registry-npm.ywwl.com/split-on-first/download/split-on-first-4.0.0.tgz","fileCount":5,"unpackedSize":4572,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCEBaHKTy3WER6eWw4Wi6+AzmXb4kldEHaUgEXNLHacLgIhAI+Szk4vqfeXk7TkNeBGDkuTq5HVBkG1uOQkjaOrlDmj"}],"size":2073,"noattachment":false,"key":"/split-on-first/-/split-on-first-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/split-on-first_4.0.0_1755681131551_0.17395139867441567"},"_hasShrinkwrap":false,"readme":"# split-on-first\n\n> Split a string on the first occurrence of a given separator\n\nThis is similar to [`String#split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), but that one splits on all the occurrences, not just the first one.\n\n## Install\n\n```sh\nnpm install split-on-first\n```\n\n## Usage\n\n```js\nimport splitOnFirst from 'split-on-first';\n\nsplitOnFirst('a-b-c', '-');\n//=> ['a', 'b-c']\n\nsplitOnFirst('key:value:value2', ':');\n//=> ['key', 'value:value2']\n\nsplitOnFirst('a---b---c', '---');\n//=> ['a', 'b---c']\n\nsplitOnFirst('a-b-c', '+');\n//=> []\n\nsplitOnFirst('abc', '');\n//=> []\n\nsplitOnFirst('a,b.c', /[.,]/);\n//=> ['a', 'b.c']\n```\n\n## API\n\n### splitOnFirst(string, separator)\n\n#### string\n\nType: `string`\n\nThe string to split.\n\n#### separator\n\nType: `string | RegExp`\n\nThe separator to split on. When a `RegExp` is provided, it splits on the first match.\n\n## Related\n\n- [split-at](https://github.com/sindresorhus/split-at) - Split a string at one or more indices\n","publish_time":1755681131738,"_cnpm_publish_time":1755681131738,"dist-tags":{"latest":"4.0.0"}}