{"name":"slice-ansi","version":"2.0.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":"^0.25.0","chalk":"^2.0.1","random-item":"^1.0.0","strip-ansi":"^5.0.0","xo":"^0.23.0"},"gitHead":"a18333d0409bdc614e372c5616bf50364136074b","bugs":{"url":"https://github.com/chalk/slice-ansi/issues"},"homepage":"https://github.com/chalk/slice-ansi#readme","_id":"slice-ansi@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==","shasum":"5373bdb8559b45676e8541c66916cdd6251612e7","tarball":"http://registry-npm.ywwl.com/slice-ansi/download/slice-ansi-2.0.0.tgz","fileCount":4,"unpackedSize":4631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxjJhCRA9TVsSAnZWagAAIlsQAI1cQSkWp11FKS1dSv5n\nk0rAtgZ7OxAh6o0Ro+0+jM6KHW21uOUsQcDFhmGSIK+urKKr0J/3r3mZQ2SZ\nWdupjkMs/Lki2Il8BKeksCr4MUSlAoTkPD32cyeHB1MlYAFPOmKVqFWzTJDl\njXXv/Rsn9+u8vKoGT+7btxZ0zlxKnr6gb4Eijb2joy8RAHVR0De8j/E7RYqd\nQDrBDsTiFn3zS2RB2wh0iApP0n6qjtWTIa9QTcJQjbv2ermgozdYSr+tJ86g\nxsD8bP81qezhwhTsP1tBmD8X/JBIxRsoZqoFCWf5nWm5HPFg1IupYfaloZhR\nPkH0zbXdccsL5WvmepvLbGhUJu4Lcq+92RoA9+sPbcKKdzCYHGYgupW7arEB\nES6he3bp1UNb8EwOXNaU8d3LWQItxSEptHeZs5e/ZPgbG7nebDKwf5cYfI7X\nD4cuQhlzsRFho60Q9A0uZx+T21E+d3ujN54iOHWRmixHjX8tUK88VXj2X7Fr\njvsjP/5UfA7WorRv8FtGOXbmkAKYJ5atMcFHvx0qx1MqViWWWn/GPVOiravz\nxQW6Z+9rUikWa1eIaYJlELWpEHgTgXQM9R4kIMxeC3651opByrTmA4kfdV4x\nvymffYRfKyCEYCCOBtuIcPdUzO+lCTAI+9IHcEtEk28RovTROVi0xaD340zy\nUPtl\r\n=c5q7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrmg4mEuZDYiVwhjpj469LyZXKvWICogmmUgiKSYV6WAIgGzSf3op/ryh+VccUamFiTkxSIEbSV7wxEOvGBewmcMQ="}],"size":2362,"noattachment":false,"key":"/slice-ansi/-/slice-ansi-2.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_2.0.0_1539715681052_0.05732325438423058"},"_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":1539715681149,"_cnpm_publish_time":1539715681149,"dist-tags":{"latest":"10.0.0"}}