{"_id":"slice-ansi@9.0.1","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"dist":{"shasum":"6754918812fed4460e215ea8ee24abedaca435c3","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-9.0.1.tgz","fileCount":6,"integrity":"sha512-aBY19bn/XA+hKOKX0qL7Z0UfdBsbQvc9hn993U8ALUjzxCvDcuZqLoRXjGJrUARWAlwMnsRVD9sw2AFNOYvalA==","signatures":[{"sig":"MEUCIQCFM/9zd8cKXGE4rtsUe28tfbDM3QtpsYY9uUYpIY9q/QIgCpQ0TVgtLL1BYR992KYDP3WMsybY+94su6zLUVmMuTM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAs+Gu0vPBMK5ytk3K8VmLrXN7qBTDuIbA8xcWZKGKOpAiEAlD997J/QK+bjXF9zqJw/0K2CYnRqZDJRFpPL117icS8="}],"unpackedSize":31260,"size":7519,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-9.0.1.tgz"},"name":"slice-ansi","type":"module","types":"./index.d.ts","engines":{"node":">=22"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/chalk/slice-ansi?sponsor=1","gitHead":"1196f5f5f8dab9727dcfc3f32c1be9d0ec83c6ac","license":"MIT","scripts":{"test":"xo && ava && tsc --lib esnext index.d.ts"},"version":"9.0.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/chalk/slice-ansi#readme","keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"repository":{"url":"git+https://github.com/chalk/slice-ansi.git","type":"git"},"_npmVersion":"12.0.1","description":"Slice a string with ANSI escape codes","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"ansi-styles":"^6.2.3","is-fullwidth-code-point":"^5.1.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^2.0.2","ava":"^7.0.0","chalk":"^5.6.2","strip-ansi":"^7.2.0","random-item":"^4.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slice-ansi_9.0.1_1789758982120_0.9163814307830742"},"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 visible-column index at which to start the slice. Grapheme clusters (for example, emoji sequences and combining marks) are kept intact.\n\n#### endSlice\n\nType: `number`\n\nZero-based visible-column index at which to end the slice.\nIf a full grapheme cluster would cross `endSlice`, it is excluded.\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":1789758982204,"_cnpm_publish_time":1789758982204,"dist-tags":{"latest":"10.0.0"}}