README
cp-dep
A command-line tool to view or copy an npm package's dependencies.
$ cp-dep <path-to-old-project> [options]
Installation
Install globally with npm.
$ npm i -g cp-dep
Features
- Print dependencies to the console
- Copy dependencies to the clipboard as an npm install command
- All dependencies
- Full dependencies only
- Dev dependencies only
How to use
Use the keyword cp-dep
and provide a path to a package.json
file.
Options
-p
,--path
: The path of the package.json you want to copy. Path defaults to the current directory if none is provided.-f
,--full
: View/Copy only full dependencies.-d
,--dev
: View/Copy only dev dependencies.-c
,--copy
: Copy the npm install command to the clipboard.-x
,--suppress
: Do not print the packages to the console.-h
,--help
: Show the help file.-u
,--upgrade
: Use current release for packages
Examples
Copy all dependencies of a project from the current directory.
$ cp-dep -c
View the dev dependencies of a project on your desktop.
$ cp-dep ~/Desktop/myProject/package.json --dev
Copy only the full dependencies from a project in your Documents folder, but don't print the results.
$ cp-dep ~/Documents/myOtherProject/ -cfx
Copy all dependencies from the project in your current folder and upgrade to the newest versions.
$ cp-dep -cu
Tests
To run the test suite, clone the repo, install the dependencies, then run npm test
:
$ git clone https://github.com/RobertMcReed/cp-dep.git
$ npm i
$ npm test
Future Release Features
- Install dependencies for a project at a given directory.
- Flag to selectively choose which packages to include in the copy command.
Change Log
1.0.0
- Initial release
1.0.1
- Readme command typos fixed
2.0.1
- Directory now defaults to the current directory
- --type flag replaced with --dev and --full
- clipboardy dependency replaced with copy-paste
3.0.0
- Install script now maintains the versioning of the copied dependencies
- Use the -u flag to upgrade all packages to the newest versions
3.0.1
- Fixed ^ slice issue with versioning