UNPKG

534 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 console.log(fileStats);
11 if (ext === '.md') {
12 // fs.readFileSync();
13 }
14
15 next();
16});
17
18
19walker.on('end', () => {
20
21 console.log('end');
22 // console.log(result);
23});
24
25walker.on('error', (e) => {
26 console.log(e);
27})
\No newline at end of file