Last active
August 29, 2015 14:27
-
-
Save lonfee88/f8033ea6e639a5ca27d9 to your computer and use it in GitHub Desktop.
node path.sep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var glob = require('glob'); | |
var path = require('path'); | |
var sep = process.platform != 'win32' ? '\\' : '/'; | |
console.log(sep); | |
var patterns = ['**/*.js', '**\\*.js']; | |
patterns.map(function(pattern){ | |
var tmp = pattern.split(sep).join(path.sep); | |
console.log(pattern); | |
console.log(tmp); | |
glob(tmp, function (er, 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. | |
console.log(files); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment