extra-npm
Version:
Common utility commands for npm packages.
79 lines (65 loc) • 2.81 kB
Plain Text
Clones NPM package to local or remote.
Clones a specific version of NPM package.
Clones all versions of NPM package.
Clones entire NPM package to GitHub repository?
Similar: [push], [clone], [init].
enpm clone [options]
package@version: name of package, optionally with version
Options:
--help: show this help
-a, --all: use all versions of package
-m, --message: commit message
-r, --repository: target github repository
-d, --description: description for repository
-h, --homepage: homepage for repository
-k, --keywords: keywords for repository
-ai, --auto_init: auto initialize repository
-gt, --gitignore_template: gitignore template for repository
-lt, --license_template: license template for repository
-u, --username: github username
-p, --password: github password
Environment variables:
NPMCLONEPACKAGE: name of package, optionally with version
NPMCLONEALL: use all versions of package (0/1)
NPMCLONEPREFIX: commit message prefix
NPMCLONEMESSAGE: commit message
NPMCLONETARGET: target github repository
NPMCLONEDESCRIPTION: description for repository
NPMCLONEHOMEPAGE: homepage for repository
NPMCLONEKEYWORDS: keywords for repository
NPMCLONEAUTO_INIT: auto initialize repository (0/1)
NPMCLONEGITIGNORE_TEMPLATE: gitignore template for repository
NPMCLONELICENSE_TEMPLATE: license template for repository
GITHUB_USERNAME: github username
GITHUB_PASSWORD: github password
$ enpm clone natural
"natural@latest" cloned to "natural"
$ enpm clone long@3.2
"long@3.2.0" cloned to "long@3.2"
$ enpm clone long --all
"long@1.0.0" cloned to "long@1.0.0"
"long@1.0.1" cloned to "long@1.0.1"
... (all versions of long)
$ enpm clone long --repository https://github.com/myusername/npmpackage1
existing repository "npmpackage1" cloned to "npmpackage1"
"long@latest" cloned to "npmpackage1"
change is pushed back to remote repository
$ enpm clone long -r myusername/npmpackage2 --username myusername --password ** --description "test"
new repository "npmpackage2" created (using authentication)
repository "npmpackage2" cloned to "npmpackage2"
"long@latest" cloned to "npmpackage2"
change is pushed back to remote repository
$ export NPMCLONEPREFIX=":+1:"
$ enpm clone mynpmpackage -a -r myusername/npmpackage3 -u myusername -p ** -d "test all"
new repository "npmpackage3" created (using authentication)
repository "npmpackage3" cloned to "npmpackage3"
"long@1.0.0" cloned to "npmpackage3"
change ":+1: v1.0.0" is pushed back to remote repository
"long@1.0.1" cloned to "npmpackage3"
change ":+1: v1.0.1" is pushed back to remote repository
... (all versions of long)
References
npm pack
[push]: https://github.com/nodef/extra-npm/wiki/push
[clone]: https://github.com/nodef/extra-npm/wiki/clone
[init]: https://github.com/nodef/extra-npm/wiki/init