{"name":"slice-ansi","version":"2.1.0","description":"Slice a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/slice-ansi.git"},"engines":{"node":">=6"},"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":"^3.2.0","astral-regex":"^1.0.0","is-fullwidth-code-point":"^2.0.0"},"devDependencies":{"ava":"^1.1.0","chalk":"^2.4.2","random-item":"^1.0.0","strip-ansi":"^5.0.0","xo":"^0.24.0"},"gitHead":"bfb33a3eb13f2d3b8023f37ddb421eff3ea7a3ae","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==","shasum":"cacd7693461a637a5788d92a7dd4fba068e81636","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-2.1.0.tgz","fileCount":4,"unpackedSize":4632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcS3yxCRA9TVsSAnZWagAApD0P/jqzsy/wS1Z4V5uVnwpf\nb7V9EiBx1Q7gU4YwxQkhCG3uLf7Q0n4j5U0xvqKTFw6WK+uWPEklrIdj3u5f\nd4eQg0W0kpdnIvTiV2r3fWl9myWDpVTDjvEwJWBcih/uDUodtXHDVZpF55Ya\nJTtFLiWgssMRW83mhOgEmcnV2cMiIYtdGY4AGPPdt2NWQBwFJOPKH3UvOVAt\ngaprNavwh41B8rcafKTHrQscskJmXetqS6wgZgRrQk+yAD6z0klfVduSQwSi\nxJ5/bTkQthNcRUpPrrV3nPZbsttwgn1BIsvWoi0G8MF4Wd00s4Mb9tYuQ/kp\nbDkAuyeIy90/Pqw1oetw+6fDh+1s4po1RDdZ5DSnGUaG9JVCB9oMwO8duGbL\nIjbU8MgE8sxuyZrnHdIt8XsMSjR1Irh4wYuVCVP/Cv7tcQFPknvH7/9PaaYB\n23/CHlBgiIJvvf1r+zNrH/hb6FBbaJRczWFbOZrujDFBhG03ljE+Qco5Iv0L\nIr6MAy9sVgjWW50QgbGAjTvBmVzDj3sR3UWpdp9z2vkExY3fwHPwQC3xiJZG\ntu0kU27oaN1IwiNY/izrpsAjIS8om7/Y6BY9Kx0mnpiTxqjy1eMsS65zBi15\n3GJ6NQXlFYNNmwZ77ohJc31XZdIRK3N7yJ6GM3LZIhLkovsse+ewF8RBRj/M\nQ+Vu\r\n=7Z9e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4g2FEwvMgPlLancK6rvFEBkOPdbikSuc7b1LsAhYwMwIgWyMNlcUSMzv/TYggnmCJoM9/iusErrHE+/PyykmgUmA="}],"size":2363,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-2.1.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_2.1.0_1548450992729_0.12519637188357136"},"_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":1548450993098,"_cnpm_publish_time":1548450993098,"dist-tags":{"latest":"10.0.0"}}