{"_id":"@cjser/slice-ansi__v5_0_0","name":"@cjser/slice-ansi__v5_0_0","dist-tags":{"latest":"5.0.0-cjser.2"},"versions":{"5.0.0-cjser.2":{"name":"@cjser/slice-ansi__v5_0_0","version":"5.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":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":">=12"},"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":{"@cjser/ansi-styles":"6.2.3-cjser.2","@cjser/is-fullwidth-code-point__v4_0_0":"4.0.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","chalk":"^4.1.0","random-item":"^4.0.0","strip-ansi":"^7.0.0","xo":"^0.38.2"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"5.0.0","cjserVersion":2,"original":{"name":"slice-ansi","version":"5.0.0","exports":"./index.js","repository":"chalk/slice-ansi","dependencies":{"ansi-styles":"^6.0.0","is-fullwidth-code-point":"^4.0.0"},"files":["index.js"],"scripts":{"test":"xo && ava"}}},"_id":"@cjser/slice-ansi__v5_0_0@5.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-EmgGLfwx5ig/GCu8geqLydycety2K1QKakEzQQyWN6vI3JgVs86Ep/yXvALR4jslHJjADwgKcQwVoZdu84vo5g==","shasum":"4ab9a827b4b09c5ad9a0313fee6aaaa2b1dfd9f0","tarball":"https://registry.npmjs.org/@cjser/slice-ansi__v5_0_0/-/slice-ansi__v5_0_0-5.0.0-cjser.2.tgz","fileCount":5,"unpackedSize":11896,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDdPfxHSf3rt5ZHJGY4AgNqGj/RgEqx2ptAhFrcjrOwnAIhAIR5HJ5MSQeCiUmJKVO7llyrNF7zBpwK5buEKNhO7yWX"}]},"_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__v5_0_0_5.0.0-cjser.2_1778160043444_0.8525094694066129"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:20:43.386Z","5.0.0-cjser.2":"2026-05-07T13:20:43.601Z","modified":"2026-05-07T13:20:43.826Z"},"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```\n$ npm 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, beginSlice, 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#### beginSlice\n\nType: `number`\n\nZero-based index at which to begin 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---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-slice_ansi?utm_source=npm-slice-ansi&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\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-a4c081c1e0baeddba0f58dc248eadde2"}