{"name":"split-on-first","version":"3.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":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["split","string","first","once","occurrence","separator","delimiter","text"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"d6bf86163df4e6490b134c303477644a52736997","bugs":{"url":"https://github.com/sindresorhus/split-on-first/issues"},"homepage":"https://github.com/sindresorhus/split-on-first#readme","_id":"split-on-first@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==","shasum":"f04959c9ea8101b9b0bbf35a61b9ebea784a23e7","tarball":"http://registry-npm.ywwl.com/split-on-first/download/split-on-first-3.0.0.tgz","fileCount":5,"unpackedSize":3776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd9iICRA9TVsSAnZWagAA2IMP/3R/hBLlWg3KSyZi/0ii\nHyzJ+ZQAnZxQB1H9nD8X9lVRH8diuLirZyjLM/XBMBqC/wRp1m7albOoW/3X\nqKB4BL3DRPUG7qoZ0o/Hdi99SDqjyvV8aAcjYbS8ffCMrYeIYCZejKOGmGO7\n2Ips4KEb3RlPttEVxu5S4khRhrWimW4BVMwc2DPFz7c3GaY6gGQimZoMtmeX\nSPzAMOYANNs8wd5sQlzBQBD7/QgB+meubB2n8fNj6Vdb07Szrr4R6y+tmeXa\nhRnk7xcYoeZnKgDRlJPPoUUT30l0emA0w5TgqtF49EneB9oGHXR0SwrIZGic\n3VAv9mfbmWVJKCzJNnikZ6rZG46f31yo5Z5WbF/epQMcpmlmZYUoIfc0l4K3\nPSGgOwQVnW+vkPFgoixpRy2eW8lT95aVV69uoeSvLuuFiiwBfwBasQJTM6zr\n20SOoHOBaNYPw2uYbOOCDTamoe3ocBoxxkZT3TEvEW8pqUZc/sqbp1uV1UyB\nSEXfSIZ0OpMiViI9XQgcCU8zM78yijrbzSredQ6GalsxHqtZym8YZcb8vzEm\nftOIdiNYU3A24YZPgiVzlOYL/kSMTOxO7MAW4PcRKl2Lq0GvSNFag1zSMIdq\nrs0o3uZ+6cO8VImDpT7uxPQ+VruUN2bmfBlsquFAWwp/VHGv74Q9scS03bc3\nmEDS\r\n=1Kgc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDECj2osO/B2PtiUd4fthvl/1Dnmah4f9CvJBn+2PFIFAiAZVFdSxbYt0R2uQ/k31anssn4Ws4nD4z2ULHQ9btgMRA=="}],"size":1854,"noattachment":false,"key":"/split-on-first/-/split-on-first-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/split-on-first_3.0.0_1618466951543_0.4764352634330624"},"_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```\n$ npm 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```\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`\n\nThe separator to split on.\n\n## Related\n\n- [split-at](https://github.com/sindresorhus/split-at) - Split a string at one or more indices\n","publish_time":1618466951688,"_cnpm_publish_time":1618466951688,"dist-tags":{"latest":"4.0.0"}}