Repository URL to install this package:
Version:
1.14.0-17740 ▾
|
brackets
/
opt
/
brackets
/
www
/
extensions
/
default
/
brackets-eslint
/
node_modules
/
slice-ansi
|
---|
.. |
index.js |
license |
package.json |
readme.md |
Slice a string with ANSI escape codes
$ npm install --save slice-ansi
var chalk = require('chalk'); var sliceAnsi = require('slice-ansi'); var input = 'The quick brown ' + chalk.red('fox jumped over ') + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); console.log(sliceAnsi(input, 20, 30));
Type: string
String with ANSI escape codes. Like one styled by chalk
.
Type: number
The zero-based index at which to begin the slice.
Type: number
Optional. The zero-based index at which to end the slice.
MIT © David Caccavella