{"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":{"integrity":"sha512-6bn4hRfkTvDfUoEQYkERg0BVF1D0vrX9HEkMl08uDiNWvVvjylLHvZFZWkDo6wjT8tUctbYl1nCOuE66ZTaUtA==","shasum":"f08a1e6703e3598256b667f015ccef9f12c59f7c","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-6.0.0.tgz","fileCount":4,"unpackedSize":7163,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFG3feXSj27aeqIWk+CnENADRUUx4vMJbzqwWzblDnMAiB4vKyRQt74ZwdT3I5d4sZbs+TuEK3s7nQDIyrf3Oj8XQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHZ1aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEzw/+Ozodo6UFm4Kln6QvruRWQhpquZYy/lvvwOKjyqwVJWner/oC\r\npditJ257JjHrOtsZbM41iI7T3GXyRArRcGszWC04xVAahMBDbN0ZPiX7nCpa\r\nhYBhxF3obJpH8xrbgm7BHN+x1WvQY/DHd+ernSZgL6WaUYHQld22q5TBh7yk\r\nbXeGYDOCRyPfgSK25coDYLRkmsj3MxUQIzMbXwXawgRsqR+n1fjSSKL8ZdEQ\r\nh/1yvlViLIhuVCdLUnQlyJrXX+C1vYU/m0iOK3WwPdYzRaaKPKxGNo57AF5w\r\nWYAGMyX+afB9WQh1iLTAqVuOTytKz+qBtaLdqqRhCXbHzfIgPILG4XRpmU8P\r\nlwAl212ITgK4ZwLANp3+HMMxxurNiOUFHtVYQN9n/N0/qbfpNP9RM+907ptm\r\no2nb2cb2xfVrXJKXHw93gYNdtiUAdqSQLJO3yNXJK1PU6YUvp8Bsn7twrlRj\r\nuBHC/FI2HWjyjndSv1OT4C42e5MdFQTMJsfXHpLbI7hg2MgNKDLL0fzNA9cA\r\nVDFbaJr3rnnT359YUYbNyjvFJy/2l4WkyWxXsoE9Fmcx6ZOAGqmCsjVajXva\r\ncRc8rBukpTZgLvXqVA/3WKNzUP2B6htarRZBm/4Ubg2OdcUUlhQ579kRSkoa\r\nwnUapIOxmrj30eTKMIafF69WsUAjG8HA3jo=\r\n=2/kf\r\n-----END PGP SIGNATURE-----\r\n","size":2993,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"qix","email":"josh@junon.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_6.0.0_1679662425973_0.9211529923591657"},"_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":1679662426115,"_cnpm_publish_time":1679662426115,"dist-tags":{"latest":"10.0.0"}}