npm.io
1.0.2 • Published 12 years ago

ansi-highlight

Licence
MIT
Version
1.0.2
Deps
2
Vulns
0
Weekly
0
Stars
4

ansi-highlight

highlight javascript in the terminal

example

var highlight = require('ansi-highlight')
var js = require('fs').readFileSync(__filename, 'utf8')
console.log(highlight(js))

see also

ansi-highlight uses regular expressions to tokenize javascript. this is very fast and simple, but is incorrect is a few weird edgecases. If need something to be completely correct, use cardinal which uses esprima to parse the javascript.

License

MIT