vfile-glob
Version:
Search files with glob pattern and create VFile objects from them
18 lines (14 loc) • 323 B
JavaScript
;
const readGlob = require('read-glob');
const vfile = require('vfile');
function globResultToVfile({contents, cwd, path, stat}) {
return vfile({
contents,
cwd,
path,
data: stat ? {stat} : {}
});
}
module.exports = function vfileGlob(...args) {
return readGlob(...args).map(globResultToVfile);
};