mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Update ESLint to v3.8.0. * Installed with `npm install --production` to avoid installing unnecessary dev files * Used `dmn -f clean` to further eliminate unneeded files PR-URL: https://github.com/nodejs/node/pull/9112 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
slice-ansi
Slice a string with ANSI escape codes
Install
$ npm install --save slice-ansi
Usage
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));
API
sliceAnsi(input, beginSlice[, endSlice])
input
Type: string
String with ANSI escape codes. Like one styled by chalk.
beginSlice
Type: number
The zero-based index at which to begin the slice.
endSlice
Type: number
Optional. The zero-based index at which to end the slice.
Related
- chalk - Terminal string styling done right
License
MIT © David Caccavella