Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

meaning of wildchar **/.* in package.json

what is the meaning of the wild char path **/.*. I see these paths are used in package.json. Can anyone point to the wild char path syntax used in package.json?

like image 692
Vijay Avatar asked Sep 09 '16 15:09

Vijay


People also ask

What is the package json file *?

The package. json file is the heart of any Node project. It records important metadata about a project which is required before publishing to NPM, and also defines functional attributes of a project that npm uses to install dependencies, run scripts, and identify the entry point to our package.

What is keywords in package json?

The keywords property inside a package. json file is, as you may have guessed, a collection of keywords about a module. Keywords can help identify a package, related modules and software, and concepts.

What is the use of scripts in package json?

What do you mean by scripts in package JSON? An npm script is a convenient way to bundle common shell commands like a set of built-in and custom scripts for your project. They are typically terminal commands or a string of terminal commands that help automate repetitive tasks.

What is private true in package json?

private. If you set "private": true in your package. json, then npm will refuse to publish it. This is a way to prevent accidental publication of private repositories. Follow this answer to receive notifications.


2 Answers

** matches any file or folder in an arbitrary sub-directory. Note that * just matches files and folders in the root directory.

**/.* matches any file beginning with a '.' (usually hidden files, like the .git folder) in an arbitrary sub-directory.

**/*.@(jpg|jpeg|gif|png) matches any file in an arbitrary sub-directory that ends with a '.' and exactly one of either 'jpg', 'jpeg', 'gif', or 'png'.

source: https://firebase.google.com/docs/hosting/full-config#section-glob

like image 107
Dan Alboteanu Avatar answered Sep 17 '22 20:09

Dan Alboteanu


That would mean "any files preceded by . in their name, which are located inside all child directories".

Not exclusive to package.json, but rather standard wildcard notation. Meaning depends which key this value was assigned to.

like image 43
vcanales Avatar answered Sep 20 '22 20:09

vcanales