If you don't want to add a new dependency to your project (like glob
), you can use plain js/node functions, like:
var files = fs.readdirSync('C:/tmp').filter(fn => fn.endsWith('.csv'));
Regex
may help in more complex comparisons
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…