|
|
před 8 roky | |
|---|---|---|
| .. | ||
| index.js | před 8 roky | |
| license | před 8 roky | |
| package.json | před 8 roky | |
| readme.md | před 8 roky | |
Regular expression for matching ANSI escape codes
$ npm install --save ansi-regex
var ansiRegex = require('ansi-regex');
ansiRegex().test('\u001b[4mcake\u001b[0m');
//=> true
ansiRegex().test('cake');
//=> false
'\u001b[4mcake\u001b[0m'.match(ansiRegex());
//=> ['\u001b[4m', '\u001b[0m']
MIT © Sindre Sorhus