highlight-self.js 462 B

1234567891011121314151617
  1. // This file will highlight itself using the default theme when run via: "node highlight-self"
  2. var cardinal = require('..');
  3. function highlight () {
  4. // Using the asynchronous highlightFile()
  5. // For synchronous highlighting use: highlightFileSync() - see highlight-self-hide-semicolons.js
  6. cardinal.highlightFile(__filename, { linenos: true }, function (err, res) {
  7. if (err) return console.error(err);
  8. console.log(res);
  9. });
  10. }
  11. highlight();