vlad 6f123ff03e 18.07 | 6 роки тому | |
---|---|---|
.. | ||
index.js | 6 роки тому | |
license | 6 роки тому | |
package.json | 6 роки тому | |
readme.md | 6 роки тому |
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