{"_id":"@cjser/slice-ansi__v8_0_0","name":"@cjser/slice-ansi__v8_0_0","dist-tags":{"latest":"8.0.0-cjser.2"},"versions":{"8.0.0-cjser.2":{"name":"@cjser/slice-ansi__v8_0_0","version":"8.0.0-cjser.2","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/chalk/slice-ansi?sponsor=1","type":"module","exports":{"types":"./index.d.ts","require":"./dist-cjser/index.cjs","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsc --lib esnext index.d.ts"},"keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"@cjser/ansi-styles":"6.2.3-cjser.2","@cjser/is-fullwidth-code-point":"5.1.0-cjser.2"},"devDependencies":{"ava":"^6.4.1","chalk":"^5.6.2","random-item":"^4.0.1","strip-ansi":"^7.1.2","xo":"^1.2.3"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"8.0.0","cjserVersion":2,"original":{"name":"slice-ansi","version":"8.0.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"chalk/slice-ansi","dependencies":{"ansi-styles":"^6.2.3","is-fullwidth-code-point":"^5.1.0"},"files":["index.js","tokenize-ansi.js","index.d.ts"],"scripts":{"test":"xo && ava && tsc --lib esnext index.d.ts"}}},"_id":"@cjser/slice-ansi__v8_0_0@8.0.0-cjser.2","gitHead":"0168e4aac54a1a9ca6f921419fa5ed9edb53ef4a","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-vTubO721aSAaRnBF3ybBY079G1k5/Y3mXU8BHLLzIaYCI2PUSA6VJ0kH5j5D1h16yU4avNxqkTPMFgia0VBAgg==","shasum":"df10455f6c1fd84bb83060dca8cb1e63efe29581","tarball":"https://registry.npmjs.org/@cjser/slice-ansi__v8_0_0/-/slice-ansi__v8_0_0-8.0.0-cjser.2.tgz","fileCount":7,"unpackedSize":57967,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICilicdy8E5puk4ipMFmsgPCaoGz7dRn8MOGOVJho3RbAiEA/M6E49Ndj3muw0kGwRbfZFijSXpgYAFkJcrXn1WW0hs="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slice-ansi__v8_0_0_8.0.0-cjser.2_1778131023690_0.5329482167827766"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T05:17:03.607Z","8.0.0-cjser.2":"2026-05-07T05:17:03.880Z","modified":"2026-05-07T05:17:04.056Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Slice a string with ANSI escape codes","keywords":["slice","string","ansi","styles","color","colour","colors","terminal","console","cli","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"license":"MIT","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.\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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/chalk/slice-ansi\n","readmeFilename":"readme.md","_rev":"1-a6bcce08ea25dc9ab1b17edf4426ed7b"}