Bachir Soussi Chiadmi cefd1c2ad0 updated sys and created publi | 7 anos atrás | |
---|---|---|
.. | ||
index.js | 7 anos atrás | |
license | 7 anos atrás | |
package.json | 7 anos atrás | |
readme.md | 7 anos atrás |
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