0.1.2 • Published 6 years ago

@regexp-extra/ansi v0.1.2

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

RegExp for matching ANSI escape codes.

const ANSI = require('@regexp-extra/ansi');
// -> regular expression (global)


ANSI.test('cake');
// false

ANSI.test('\u001b[4mcake\u001b[0m');
// true

'\u001b[4mcake\u001b[0m'.match(ANSI);
// ['\u001b[4m', '\u001b[0m']

new RegExp(ANSI).exec('\u001b[4mcake\u001b[0m');
// [ '\u001b[4m',
//   index: 0,
//   input: '\u001b[4mcake\u001b[0m',
//   groups: undefined ]

NPM

credits: taken directly from chalk/ansi-regex.

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago