{"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":{"integrity":"sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==","shasum":"b73063c57aa96f9cd881654b15294d95d285c42a","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-5.0.0.tgz","fileCount":4,"unpackedSize":6412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeTAtCRA9TVsSAnZWagAASCkQAI7nAvFCq3NZ4et7NpZ3\n2MumoLJ/+NN6sDqEPfg7ZBP8R7nGVRAAUYwv19oZS9xjPWTT2xB4VAagSCYI\nDTkZ7/Fq3JZath4RQOjvz71dKdI4gBg0jXRHr4fVEzzDGC8QNLu5rCiHEN89\n8+SaPC8V0ekIRnbvtKahPw2+TzIFKCD2E+gb9w0op/zJbeMpmeLRUCxmHJee\nMJ6MOg+2d9gR4GDkhV4PXHfV/WA9kJ3eekYTBOkVw5kZVlcqOzHKbnVGHaFD\n04GiXkIomHAZjyxvQR0uKXIxGoEWAVGGjDbHNaCMtSiQ0gTKNwhJz6P3xfJm\n2Grnma1sRpaGizX98k54P9wVECGuJDiKTplHUQYmnpba5LAlf5McDDDXDu5S\nKP0+RWitf1N3FE+NgPQzH+0pM1yRXBT1unx1YV5FOB20+e1rSjOe7LOo7fya\n3X6ghDy9aCemZouiaDgtZHJcQWqc21Y8NV+AfmOwwWfiUdMbqQFDCKHVdwqc\ntZefRUEhxZXO6Z43Tx+lwfCLrXGgRW3zilWR2UhgVcvD1HjXaZ+GidHU8c6T\n6eJvIzET1ho9SoZ8IDnROHztexMp/abLvCpjdSw/OdLUhlEbL0e9ce/c6Lle\nm87HLBO2sl3LRUCAuXtCHJE95B3yj87M2QXnHXMAOjVO5lvFxEOC/FocXOpT\njTgU\r\n=HO5X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFLjmdSt5ldaekwhA5PqP9uk7nDjMHhs6SZgvJgIpm1+AiEA79zNf/LQgqf7UIL/9ATOrbwJ6FsndI4yjkHoxcM+XMg="}],"size":3013,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-5.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"qix","email":"i.am.qix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_5.0.0_1618554925317_0.6554479181002966"},"_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","publish_time":1618554925429,"_cnpm_publish_time":1618554925429,"dist-tags":{"latest":"10.0.0"}}