0
在nodejs中,如果給定一個字符串「foo- *」,我如何才能找到以foo開頭的所有目錄名?如何查找與nodejs中的通配符匹配的任何目錄?
E.g.搜索將返回FOO酒吧,FOO奶酪等
我有什麼至今:
// If The directory name contains a wildcard character
// search all directory names with the preceding characters.
let wildcard = '*';
if (directory.indexOf(wildcard) !== -1) {
// Search for directories that contain the directory string (without the *).
}
我什麼也看不見的文件系統模塊中是有用的。
我去了glob模塊。 – chap