{"_id":"slice-ansi","_rev":"261532","name":"slice-ansi","description":"Slice a string with ANSI escape codes","dist-tags":{"latest":"6.0.0"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"time":{"modified":"2023-03-27T17:29:51.000Z","created":"2015-09-26T04:25:26.276Z","6.0.0":"2023-03-24T12:53:46.115Z","5.0.0":"2021-04-16T06:35:25.429Z","4.0.0":"2020-02-16T17:06:07.255Z","3.0.0":"2019-09-17T17:50:39.941Z","2.1.0":"2019-01-25T21:16:33.098Z","2.0.0":"2018-10-16T18:48:01.149Z","1.0.0":"2017-07-10T10:18:53.559Z","0.1.0":"2017-06-21T22:51:30.760Z","0.0.4":"2015-09-26T07:53:28.041Z","0.0.3":"2015-09-26T04:49:56.857Z","0.0.2":"2015-09-26T04:25:26.276Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"versions":{"6.0.0":{"name":"slice-ansi","version":"6.0.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"funding":"https://github.com/chalk/slice-ansi?sponsor=1","type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava"},"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"ansi-styles":"^6.2.1","is-fullwidth-code-point":"^4.0.0"},"devDependencies":{"ava":"^5.2.0","chalk":"^5.2.0","random-item":"^4.0.1","strip-ansi":"^7.0.1","xo":"^0.53.1"},"gitHead":"d0e08a8f80ba9bbcccd60a3f879e95904a6e2d5b","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@6.0.0","_nodeVersion":"14.21.3","_npmVersion":"9.2.0","dist":{"shasum":"f08a1e6703e3598256b667f015ccef9f12c59f7c","size":2993,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-6.0.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_6.0.0_1679662425973_0.9211529923591657"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-24T12:53:46.115Z","publish_time":1679662426115,"_cnpm_publish_time":1679662426115},"5.0.0":{"name":"slice-ansi","version":"5.0.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"funding":"https://github.com/chalk/slice-ansi?sponsor=1","type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"ansi-styles":"^6.0.0","is-fullwidth-code-point":"^4.0.0"},"devDependencies":{"ava":"^3.15.0","chalk":"^4.1.0","random-item":"^4.0.0","strip-ansi":"^7.0.0","xo":"^0.38.2"},"gitHead":"d9f402cdbbccc399e6380f39fe7e6d800e9da1f3","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@5.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b73063c57aa96f9cd881654b15294d95d285c42a","size":3013,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-5.0.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-5.0.0.tgz"},"directories":{},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_5.0.0_1618554925317_0.6554479181002966"},"_hasShrinkwrap":false,"publish_time":1618554925429,"_cnpm_publish_time":1618554925429,"_cnpmcore_publish_time":"2021-12-14T04:31:58.317Z"},"4.0.0":{"name":"slice-ansi","version":"4.0.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"funding":"https://github.com/chalk/slice-ansi?sponsor=1","engines":{"node":">=10"},"scripts":{"test":"xo && ava"},"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"ansi-styles":"^4.0.0","astral-regex":"^2.0.0","is-fullwidth-code-point":"^3.0.0"},"devDependencies":{"ava":"^2.1.0","chalk":"^3.0.0","random-item":"^3.0.0","strip-ansi":"^6.0.0","xo":"^0.26.1"},"gitHead":"6e1176c06fc3a2b22d35584b788f18c710adb2e8","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@4.0.0","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"500e8dd0fd55b05815086255b3195adf2a45fe6b","size":2979,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-4.0.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-4.0.0.tgz"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_4.0.0_1581872767116_0.100639054554162"},"_hasShrinkwrap":false,"publish_time":1581872767255,"_cnpm_publish_time":1581872767255},"3.0.0":{"name":"slice-ansi","version":"3.0.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"ansi-styles":"^4.0.0","astral-regex":"^2.0.0","is-fullwidth-code-point":"^3.0.0"},"devDependencies":{"ava":"^2.1.0","chalk":"^2.4.2","random-item":"^3.0.0","strip-ansi":"^5.0.0","xo":"^0.24.0"},"gitHead":"adc843879c765ccd06df78297eefe628bc3392da","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@3.0.0","_nodeVersion":"8.16.1","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"31ddc10930a1b7e0b67b08c96c2f49b77a789787","size":2915,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-3.0.0.tgz"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_3.0.0_1568742639842_0.1062825822566047"},"_hasShrinkwrap":false,"publish_time":1568742639941,"_cnpm_publish_time":1568742639941},"2.1.0":{"name":"slice-ansi","version":"2.1.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"ansi-styles":"^3.2.0","astral-regex":"^1.0.0","is-fullwidth-code-point":"^2.0.0"},"devDependencies":{"ava":"^1.1.0","chalk":"^2.4.2","random-item":"^1.0.0","strip-ansi":"^5.0.0","xo":"^0.24.0"},"gitHead":"bfb33a3eb13f2d3b8023f37ddb421eff3ea7a3ae","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"cacd7693461a637a5788d92a7dd4fba068e81636","size":2363,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-2.1.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-2.1.0.tgz"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_2.1.0_1548450992729_0.12519637188357136"},"_hasShrinkwrap":false,"publish_time":1548450993098,"_cnpm_publish_time":1548450993098},"2.0.0":{"name":"slice-ansi","version":"2.0.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"ansi-styles":"^3.2.0","astral-regex":"^1.0.0","is-fullwidth-code-point":"^2.0.0"},"devDependencies":{"ava":"^0.25.0","chalk":"^2.0.1","random-item":"^1.0.0","strip-ansi":"^5.0.0","xo":"^0.23.0"},"gitHead":"a18333d0409bdc614e372c5616bf50364136074b","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5373bdb8559b45676e8541c66916cdd6251612e7","size":2362,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-2.0.0.tgz"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_2.0.0_1539715681052_0.05732325438423058"},"_hasShrinkwrap":false,"publish_time":1539715681149,"_cnpm_publish_time":1539715681149},"1.0.0":{"name":"slice-ansi","version":"1.0.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"author":{"name":"David Caccavella","email":"threedeecee@gmail.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"is-fullwidth-code-point":"^2.0.0"},"devDependencies":{"ava":"*","chalk":"^2.0.1","random-item":"^1.0.0","strip-ansi":"^4.0.0","xo":"*"},"gitHead":"c63bf1eb57394c7d958a0c9d6c7db2f1a4cb2e93","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@1.0.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"044f1a49d8842ff307aad6b505ed178bd950134d","size":2527,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-1.0.0.tgz"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi-1.0.0.tgz_1499681932678_0.883340407628566"},"directories":{},"publish_time":1499681933559,"_cnpm_publish_time":1499681933559,"_hasShrinkwrap":false},"0.1.0":{"name":"slice-ansi","version":"0.1.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"author":{"name":"David Caccavella","email":"threedeecee@gmail.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"devDependencies":{"ava":"*","chalk":"^1.1.1","random-item":"^1.0.0","strip-ansi":"^4.0.0","xo":"*"},"gitHead":"9ffcf2edf821f3b964375a1eac8482264603936e","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@0.1.0","_shasum":"a884ecf178e98c36ae4f629253778a24d12ed17b","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a884ecf178e98c36ae4f629253778a24d12ed17b","size":2372,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-0.1.0.tgz"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi-0.1.0.tgz_1498085489784_0.24906234815716743"},"directories":{},"publish_time":1498085490760,"_cnpm_publish_time":1498085490760,"_hasShrinkwrap":false},"0.0.4":{"name":"slice-ansi","version":"0.0.4","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"author":{"name":"David Caccavella","email":"threedeecee@gmail.com"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js && xo"},"files":["index.js"],"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{},"devDependencies":{"ava":"^0.2.0","chalk":"^1.1.1","strip-ansi":"^3.0.0","xo":"*"},"gitHead":"8670277262281964b13f051d51b2e24bcfda8a66","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@0.0.4","_shasum":"edbf8903f66f7ce2f8eafd6ceed65e264c831b35","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.2.0","_npmUser":{"name":"dthree","email":"threedeecee@gmail.com"},"dist":{"shasum":"edbf8903f66f7ce2f8eafd6ceed65e264c831b35","size":2436,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-0.0.4.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-0.0.4.tgz"},"directories":{},"publish_time":1443254008041,"_cnpm_publish_time":1443254008041,"_hasShrinkwrap":false},"0.0.3":{"name":"slice-ansi","version":"0.0.3","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"author":{"name":"David Caccavella","email":"threedeecee@gmail.com"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js && xo"},"files":["index.js"],"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{},"devDependencies":{"ava":"^0.2.0","chalk":"^1.1.1","strip-ansi":"^3.0.0","xo":"*"},"gitHead":"5582973fe42a2df861cdf09907b28a3bb634f5de","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@0.0.3","_shasum":"9ee38472a17a9f0f72e7ebc9ec0c328c39dc4a8b","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.2.0","_npmUser":{"name":"dthree","email":"threedeecee@gmail.com"},"dist":{"shasum":"9ee38472a17a9f0f72e7ebc9ec0c328c39dc4a8b","size":2465,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-0.0.3.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-0.0.3.tgz"},"directories":{},"publish_time":1443242996857,"_cnpm_publish_time":1443242996857,"_hasShrinkwrap":false},"0.0.2":{"name":"slice-ansi","version":"0.0.2","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"author":{"name":"David Caccavella","email":"threedeecee@gmail.com"},"maintainers":[{"name":"qix","email":""},{"name":"sindresorhus","email":""}],"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js && xo"},"files":["index.js"],"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{},"devDependencies":{"ava":"^0.2.0","chalk":"^1.1.1","strip-ansi":"^3.0.0","xo":"*"},"gitHead":"8b9fa7210c722fed80b5330146e4ada1a9c4db6a","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@0.0.2","_shasum":"bf0579e665125dd7a7626bd592d337cbffcfe7b3","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.2.0","_npmUser":{"name":"dthree","email":"threedeecee@gmail.com"},"dist":{"shasum":"bf0579e665125dd7a7626bd592d337cbffcfe7b3","size":2428,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-0.0.2.tgz","tarball":"http://name.csiicloud.com:7001/slice-ansi/download/slice-ansi-0.0.2.tgz"},"directories":{},"publish_time":1443241526276,"_cnpm_publish_time":1443241526276,"_hasShrinkwrap":false}},"readme":"# slice-ansi [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/xojs/xo)\n\n> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)\n\n## Install\n\n```sh\nnpm install slice-ansi\n```\n\n## Usage\n\n```js\nimport chalk from 'chalk';\nimport sliceAnsi from 'slice-ansi';\n\nconst string = 'The quick brown ' + chalk.red('fox jumped over ') +\n\t'the lazy ' + chalk.green('dog and then ran away with the unicorn.');\n\nconsole.log(sliceAnsi(string, 20, 30));\n```\n\n## API\n\n### sliceAnsi(string, startSlice, endSlice?)\n\n#### string\n\nType: `string`\n\nString with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).\n\n#### startSlice\n\nType: `number`\n\nZero-based index at which to start the slice.\n\n#### endSlice\n\nType: `number`\n\nZero-based index at which to end the slice.\n\n## Related\n\n- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes\n- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [Josh Junon](https://github.com/qix-)\n","_attachments":{},"homepage":"https://github.com/chalk/slice-ansi#readme","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"license":"MIT"}