1.0.0 • Published 5 years ago

grab-deps-cli v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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

  1. Install the package globally: npm i -g grab-deps-cli
  2. Go to the folder of the new project: cd projects/new
  3. Init this project to add package.json (e.g. by using npm): npm init
  4. 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

  1. cd projects/new
  2. grab-deps ../projects/old

Magic! All packages from the old project will be installed to the new one.

2. Exclude dependencies

  1. cd projects/new
  2. grab-deps ../projects/old -e prettier

All packages except prettier will be installed.

3. Show deps for installation (without installing)

  1. cd projects/new
  2. 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.