{"_id":"@cjser/slice-ansi__v7_1_2","name":"@cjser/slice-ansi__v7_1_2","dist-tags":{"latest":"7.1.2-cjser.2"},"versions":{"7.1.2-cjser.2":{"name":"@cjser/slice-ansi__v7_1_2","version":"7.1.2-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":">=18"},"scripts":{"test":"xo && ava && tsc 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":"^5.3.1","chalk":"^5.3.0","random-item":"^4.0.1","strip-ansi":"^7.1.0","xo":"^0.56.0"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"7.1.2","cjserVersion":2,"original":{"name":"slice-ansi","version":"7.1.2","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"chalk/slice-ansi","dependencies":{"ansi-styles":"^6.2.1","is-fullwidth-code-point":"^5.0.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsc index.d.ts"}}},"_id":"@cjser/slice-ansi__v7_1_2@7.1.2-cjser.2","gitHead":"0168e4aac54a1a9ca6f921419fa5ed9edb53ef4a","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-0kh7GaxeE0Xgj21nTIUR2GQUkHF9GVVOXLTM6QG6GCBBRJ6+rC+/GdgwqgtHNFy09Jjs0s0rc5TMonMU8MXlcQ==","shasum":"ccb371bda63bc1bc28045f05f9849210124254a9","tarball":"https://registry.npmjs.org/@cjser/slice-ansi__v7_1_2/-/slice-ansi__v7_1_2-7.1.2-cjser.2.tgz","fileCount":6,"unpackedSize":14866,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGLxHBNmCn6pWnavtMPRb3me9oTKxOoV+4pj7GJzqBa1AiEAtsLdLkBc9gDvYIPcwkO+QSjTdQc5mFPFDUq80ekKqBs="}]},"_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__v7_1_2_7.1.2-cjser.2_1778131019243_0.5132140414791104"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T05:16:59.138Z","7.1.2-cjser.2":"2026-05-07T05:16:59.408Z","modified":"2026-05-07T05:16:59.670Z"},"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 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\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-c1bb0233966192abc03340bf9901d502"}