Skip to content

Commit

Permalink
Added syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
exdis committed Jul 25, 2019
1 parent 4055ec0 commit aca4ce2
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 92 deletions.
Empty file modified bin/jora
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const fs = require('fs');
const path = require('path');
const cli = require('clap');
const highlight = require('cli-highlight').highlight;
const jora = require('jora/dist/jora');

function readFromStream(stream, processBuffer) {
Expand Down Expand Up @@ -88,7 +89,7 @@ function processStream(options) {
if (options.outputFile) {
fs.writeFileSync(options.outputFile, serializedResult, 'utf-8');
} else {
console.log(serializedResult);
console.log(highlight(serializedResult, {language: 'json', ignoreIllegals: true}));
}
});
}
Expand Down
Loading

0 comments on commit aca4ce2

Please sign in to comment.