Sowmay Jain
Sowmay Jain

Reputation: 955

What does **/* mean while defining the file directory?

I came over this * sign while (learning about NodeJS) defining the file path. What does it actually means?

Upvotes: 0

Views: 689

Answers (2)

Adiii
Adiii

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.
})

click here for more detail

Upvotes: 0

Sergio Tulentsev
Sergio Tulentsev

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

Related Questions