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