highlight-self.js 463 B

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