Skip to content

Commit

Permalink
Merge 975b968 into 52820ac
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Aug 9, 2019
2 parents 52820ac + 975b968 commit 654a70e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -7,7 +7,7 @@
"eslint": "eslint .",
"test": "mocha test/index.js",
"test-cov": "nyc npm run test",
"build:highlight": "node scripts/build_highlight_alias.js > highlight_alias.json",
"build:highlight": "node scripts/build_highlight_alias.js",
"prepare": "npm run build:highlight"
},
"directories": {
Expand All @@ -16,7 +16,8 @@
},
"files": [
"lib/",
"scripts/"
"scripts/",
"highlight_alias.json"
],
"repository": "hexojs/hexo-util",
"homepage": "https://hexo.io/",
Expand Down
8 changes: 7 additions & 1 deletion scripts/build_highlight_alias.js
Expand Up @@ -2,6 +2,7 @@

var hljs = require('highlight.js');
var languages = hljs.listLanguages();
const fs = require('fs');

var result = {
languages: languages,
Expand All @@ -21,4 +22,9 @@ languages.forEach(function(lang) {
}
});

console.log(JSON.stringify(result));
const stream = fs.createWriteStream('highlight_alias.json');
stream.write(JSON.stringify(result));
stream.on('end', () => {
stream.end();
});

0 comments on commit 654a70e

Please sign in to comment.