UNPKG

571 BJavaScriptView Raw
1const fs = require('fs');
2const path = require('path');
3const walk = require('walk');
4const config = require('./config');
5
6const walker = walk.walk(config.root);
7walker.on('file', function (root, fileStats, next) {
8 const basename = fileStats.name;
9 const ext = path.extname(basename);
10
11 const file = path.resolve(__dirname, root + '/' + basename);
12 console.log(file);
13 if (ext === '.md') {
14 fs.readFileSync(file);
15 }
16
17 next();
18});
19
20
21walker.on('end', () => {
22
23 // console.log('end');
24});
25
26walker.on('error', (e) => {
27 console.log(e);
28})
\No newline at end of file