mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 05:01:48 +00:00
![]() PR-URL: https://github.com/nodejs/node/pull/7999 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> |
||
---|---|---|
.. | ||
index.js | ||
license | ||
package.json | ||
readme.md |
ansi-regex 
Regular expression for matching ANSI escape codes
Install
$ npm install --save ansi-regex
Usage
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']
License
MIT © Sindre Sorhus