Pygments
A pygments wrapper for node.js
Installation
Installing npm (node package manager)
curl http://npmjs.org/install.sh | sh
Installing pygments
[sudo] npm install pygments
Usage
colorize(target, lexer, format, callback, [options]);
- Default lexer is
js
- Default format is
html
Highlight code
var highlight = colorize; ;
Highlight a file
var highlight = colorize; ;
If you want to highlight string /home/pkumar/package.json
itself,
var highlight = colorize; ;
Run Tests
All of the pygments tests are written in vows, and cover all of the use cases described above.
npm test
License
See LICENSE for details.
Contact
Pavan Kumar Sunkara