Nicholas Maidanos 23f6576076 Channel stuff added | vor 6 Jahren | |
---|---|---|
.. | ||
node_modules/is-fullwidth-code-point | vor 6 Jahren | |
index.js | vor 6 Jahren | |
license | vor 6 Jahren | |
package.json | vor 6 Jahren | |
readme.md | vor 6 Jahren |
Slice a string with ANSI escape codes
$ npm install slice-ansi
const chalk = require('chalk');
const sliceAnsi = require('slice-ansi');
const 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
Zero-based index at which to begin the slice.
Type: number
Zero-based index at which to end the slice.
MIT