{"name":"slice-ansi","version":"4.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","engines":{"node":">=10"},"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":"^4.0.0","astral-regex":"^2.0.0","is-fullwidth-code-point":"^3.0.0"},"devDependencies":{"ava":"^2.1.0","chalk":"^3.0.0","random-item":"^3.0.0","strip-ansi":"^6.0.0","xo":"^0.26.1"},"gitHead":"6e1176c06fc3a2b22d35584b788f18c710adb2e8","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@4.0.0","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==","shasum":"500e8dd0fd55b05815086255b3195adf2a45fe6b","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-4.0.0.tgz","fileCount":4,"unpackedSize":6434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSXZ/CRA9TVsSAnZWagAAIeUQAJBGqJTemkljPXjPi976\njQ+aqYI/0rdP1A1bAOnfYSDAJ6zmz32nVxTJmerjA84wy2rFP/fGRfyqTJVo\n9Y/Qo24MQ5NSOW/BTARCpxXSHU3y8JSICxTY0niAMYGTpyOzUmpHwsQo8OIu\n3sxx1DkWeEulcDt89r227y8jcwu7Gze5fuNWDDxr2enTHAy3qyJA748ivdXs\nFJ3RUp1IwlIrMl8vXy3CaoUJnBQn6sv3vukH0zK3PSOSBSzShLJoc6IA94Fw\n2wBsHZH69HGt4vbrWwnLSRZGgJ54ORyy0aToaxLP5Pg1TttuRyQp6VTwICEI\nSuxUZuwVtFxcZg88Ywy/nZq0Pllzd+YTTJRHYV7SHjiyTkSCUwaBDhqFXVP5\nkd9ABwGhJ+1GwbrfXq2L5KdzeC49n3XYu5tXYzmpPT+mWHSBxUzCuznep2zu\nZyytRzkSqlQUgV10aS7tjsO79KY9kWVNknEWdLHI14NLgzwmrcp5Fspa95Je\nWdFm/aTqhvXGyYsbOppZneBN/JN7oPhbWniz4VC7S99W3lAh+9lIMiEFiQLy\nh/GnVhG020t9jWKY9X4pi1vtRQjfm8GOQu/AbZ63tj8zoDd6TG0FLTbhzzDH\nsVE0yOyhCQwhLNWXLRnA2TZaDnUIfkpxGkzkY14w7w7bvTNStWE05VER9OLw\nHQNu\r\n=MR7Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUsHzrAe4SbstL8K4DvEfGuMPAF8fqDD4FM/7PzzaLxAiBqLsmnZu4b+RtymMHSTZa5RpaKxPiLhkpjJR4SlFBhCg=="}],"size":2979,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-4.0.0.tgz"},"maintainers":[{"email":"i.am.qix@gmail.com","name":"qix"},{"email":"sindresorhus@gmail.com","name":"sindresorhus"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slice-ansi_4.0.0_1581872767116_0.100639054554162"},"_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":1581872767255,"_cnpm_publish_time":1581872767255,"dist-tags":{"latest":"10.0.0"}}