{"name":"slice-ansi","version":"7.0.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"funding":"https://github.com/chalk/slice-ansi?sponsor=1","type":"module","exports":"./index.js","engines":{"node":">=14.16"},"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":{"ansi-styles":"^6.2.1","is-fullwidth-code-point":"^5.0.0"},"devDependencies":{"ava":"^5.3.1","chalk":"^5.3.0","random-item":"^4.0.1","strip-ansi":"^7.1.0","xo":"^0.56.0"},"gitHead":"8c0653649528ffb2a2a1e5467005289186d8076b","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@7.0.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"integrity":"sha512-AkAZP6rVu1V3D+B5CocNzW83TlqiV9cI/Eb/Thr2u5TvoqPW5uzOhJfhZk5PG5jiXTmX8mhaq0/GkyGz29qtEg==","shasum":"ab9f083694ed8039b845f5f79a05938ca1ddc331","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-7.0.0.tgz","fileCount":4,"unpackedSize":7163,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtPGsWfyDoHizWaDJPJgukfCQXLaQO0h0aCqykR4wBegIhAOaNW9H7c5FBW9ZiffZVWkcV9Z4xp6/14tCWxliUN1tz"}],"size":2996,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-7.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"qix","email":"josh@junon.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_7.0.0_1698510551390_0.8108065326577072"},"_hasShrinkwrap":false,"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","publish_time":1698510551606,"_cnpm_publish_time":1698510551606,"dist-tags":{"latest":"10.0.0"}}