root-installer v1.0.0
Root installer
Installation
npm install root-installer
Usage
You can use either a npm script or run the command from your terminal at your root directory
As node script
"scripts": {
"root-installer": "node node_modules/root-installer -d 'app storybook' -p 'react redux'"
}
Options:
-d, --directories
A list of the directories separated by `,`
They operate as relative paths from the process.cwd().
e.g. -d 'dir1 dir2 sites/dir2' for a file structure of
ROOT
|_package.json
|_dir1
|_dir2
|_sites
|_dir3
-p, --packages
A list of packages separated by `,`
e.g. -p 'react redux'.
-v, --dev-packages
A list of packages separated by `,`
e.g. -v 'lodash sass-loader'.
if you do not specify packages or dev-packages
then it will run npm i
in the specified directories.
From the terminal
Same stuff just navigate to your root dir (or whichever dir you like to base your directories relative path definitions) and then something like:
node node_modules/root-installer -d 'app storybook' -v 'node-sass lodash'
OR
node node_modules/root-installer -d 'app storybook' -p 'react redux'
Current Status
root-installer is a package that installs a list of packages in a list of directories. The point is to avoid all the cd
s and to be able to bulk install in different dirs if needed.
Keep in mind that we create one node process per directory so don't ovedo it ;)
Output
When you run the script you will see whatever npm i
outputs as a process.
Limitations
We need to run separate commands for normal and dev dependencies.
Features to come
- CLI option for ROOT_DIR
Contributions
I would very much appreciate any code contributions. Either to solve our limitations or create more features.
License
Support
root-installer is supported on Node 8 and above.
4 years ago