I want to get the list of filename inside multiple directories which contains file-name as a string in filename. For example
here is what i have done so far
var glob = require("glob")
glob(process.cwd() + "/directory/**/*-file-name*.*", {}, function (er,
files) {
console.log(files)
})
I am only getting files which contains abcd-file-name-abcd.js
This should match your required solution
var glob = require("glob")
glob(process.cwd() + "/directory/**/?(*|*-)file-name?(-*).*", {}, function (er,
files) {
console.log(files)
})
Resources: