{"name":"slice-ansi","version":"8.0.0","keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"license":"MIT","_id":"slice-ansi@8.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/chalk/slice-ansi#readme","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"dist":{"shasum":"22d0b66d18bc5c57f488bfcf36cbde3bef731537","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-8.0.0.tgz","fileCount":6,"integrity":"sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==","signatures":[{"sig":"MEQCIBDAY8KluCKBSttjYQRvcwQDmFVu/eqTkzGJc2ypi4DoAiAfqY8w+1VaTB1OSqiS4OFmPR66gz3uyEkfdLFYHF7AGw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29134,"size":7016,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-8.0.0.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/chalk/slice-ansi?sponsor=1","gitHead":"2ea51ac0596c4c4f240826cef211551fd812adb9","scripts":{"test":"xo && ava && tsc --lib esnext index.d.ts"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/chalk/slice-ansi.git","type":"git"},"_npmVersion":"11.8.0","description":"Slice a string with ANSI escape codes","directories":{},"sideEffects":false,"_nodeVersion":"25.6.0","dependencies":{"ansi-styles":"^6.2.3","is-fullwidth-code-point":"^5.1.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1","chalk":"^5.6.2","strip-ansi":"^7.1.2","random-item":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/slice-ansi_8.0.0_1770740748873_0.3406857856325636","host":"s3://npm-registry-packages-npm-production"},"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":1770740749022,"_cnpm_publish_time":1770740749022,"dist-tags":{"latest":"10.0.0"}}