Files
TechRadarAJR/scripts/create.js
2017-01-22 20:57:46 +01:00

53 lines
1.0 KiB
JavaScript

import {
readFile,
outputFile,
} from 'fs-extra';
import frontmatter from 'front-matter';
import marked from 'marked';
import waterfall from 'async/waterfall';
import {
srcPath,
distPath,
} from './file';
import {
getTree,
createRadar,
} from './radar';
(async () => {
try {
// const tree = await getTree();
// console.log(JSON.stringify(tree, null, 2));
const radar = await createRadar();
console.log(JSON.stringify(radar, null, 2));
} catch(e) {
console.error('error:', e);
}
})()
//
// const fileName = srcPath('v1/tools/grunt.md');
//
// console.log('<<< start creating files');
//
// waterfall([
// (callback) => {
// readFile(fileName, 'utf8', callback);
// },
// (data, callback) => {
// const item = frontmatter(data);
// const html = marked(item.body);
//
// outputFile(distPath('test3.html'), html, callback);
// }
// ],
// (err, results) => {
// if (!err) {
// console.log('done creating files >>>');
// } else {
// console.error(err);
// }
// }
// );