grab-deps-cli v1.0.0
grab-deps-cli
npm i -g grab-deps-cli
Why
When you want to create the new project based on the old one, you need to install the same dependencies there. In this case, you are faced with the installing of these packages manually.
You can skirt around this problem by using grab-deps-cli
. With it, you are able to grab the dependencies for the new project from the other one in the seconds.
Usage
- Install the package globally:
npm i -g grab-deps-cli
- Go to the folder of the new project:
cd projects/new
- Init this project to add
package.json
(e.g. by using npm):npm init
- Grab the dependencies from the old project:
grab-deps ../projects/old
Warning: Path to the old project is required!
Options
--exclude <packages> (-e <packages>)
: Exclude packages from the list
--show (-s)
: Show packages from the list without installing
Examples
Setup
In the old project:
// projects/old/package.json
{
...
"dependencies": {
"react": "^16.7.0",
"react-dom": "^16.7.0",
...
},
"devDependencies": {
"@types/react": "^16.7.18",
"@types/react-dom": "^16.0.11",
"prettier": "^1.15.3",
...
},
...
}
In the new project (after init):
// projects/new/package.json
{
...
"dependencies": {},
"devDependencies": {},
...
}
1. Basic
cd projects/new
grab-deps ../projects/old
Magic! All packages from the old project will be installed to the new one.
2. Exclude dependencies
cd projects/new
grab-deps ../projects/old -e prettier
All packages except prettier
will be installed.
3. Show deps for installation (without installing)
cd projects/new
grab-deps ../projects/old -e prettier --show
Nothing will be installed, this is preview mode - you can see what packages will be installed in the future without --show
flag.
5 years ago