NPM酷庫,天天兩分鐘,瞭解一個流行NPM庫。node
昨天,咱們學習了一個新庫 glob,用於模式匹配目錄文件。今天,咱們要了解的globby,是基於 glob,並進一步獲得了加強了功能。git
相對於 glob,globby有如下加強功能github
dir
→ dir/**/*
.gitignore
(async () => { const paths = await globby(['images','photos'],{ expandDirectories: true }); console.log(paths); })();
gitignore:async
const { gitignore } = require('globby'); (async () => { const isIgnored = await gitignore(); console.log(isIgnored('some/file')); })();
glob: https://github.com/isaacs/nod...學習
globby: https://github.com/sindresorh...ui
天天瞭解一個NPM庫,一年後成爲Node.js高手spa