Reputation: 955
I came over this * sign while (learning about NodeJS) defining the file path. What does it actually means?
Upvotes: 0
Views: 689
Reputation: 59966
"Globs" are the patterns you type when you do stuff like ls *.js
on the command line, or put build/*
in a .gitignore file.
*
Matches 0 or more characters in a single path portion
**
If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches
var glob = require("glob")
glob("**/*.js", options, 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.
})
Upvotes: 0
Reputation: 230346
It's a glob syntax. In a **/*
, the **
means "any directory, even nested in another directory" and *
means the usual "any filename".
Upvotes: 4