control-freak-ide/server/nodejs/testGlob.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

23 lines
600 B
JavaScript

var mm = require('micromatch');
//var str = mm.makeRe(['*.js','*.dot']);
//console.log('_str ',mm);
var glob = require("glob");
//glob.option('cwd', '/');
var options = {
//cwd:"/PMaster"
cwd:"/home/mc007/Music/Sasha/"
};
// options is optional
//"*.sql|*.txt|!(*.*)
glob("/home/mc007/Music/Sasha/+(*.mp3|*.wav|*.m4a)", options, function (er, files) {
//console.log('error ',er);
console.log('c: ',files);
// files is an array of filenames.
// If the `nonull` option is set, and nothing
// was found, then files is ["**/*.js"]
// er is an error object or null.
});