mirror of
https://github.com/ElemeFE/node-interview.git
synced 2026-01-25 16:46:33 +00:00
Section Util: update glob example
最后一个小例子好像有点问题
This commit is contained in:
parent
67e5b990e4
commit
c8c9f6e223
@ -221,10 +221,12 @@ console.log(traversal('.'));
|
||||
```javascript
|
||||
const glob = require("glob");
|
||||
|
||||
glob("**/*.js", (err, files) {
|
||||
glob("**/*.js", (err, files) => {
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
console.log('Here you are:', files.map(path.basename));
|
||||
files.map((filename) => {
|
||||
console.log('Here you are:', filename);
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user