-
Notifications
You must be signed in to change notification settings - Fork 0
clone
Subhajit Sahu edited this page Apr 24, 2021
·
5 revisions
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?
enpm clone [options] <package@version>
# 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:
# NPM_CLONE_PACKAGE: name of package, optionally with version
# NPM_CLONE_ALL: use all versions of package (0/1)
# NPM_CLONE_PREFIX: commit message prefix
# NPM_CLONE_MESSAGE: commit message
# NPM_CLONE_TARGET: target github repository
# NPM_CLONE_DESCRIPTION: description for repository
# NPM_CLONE_HOMEPAGE: homepage for repository
# NPM_CLONE_KEYWORDS: keywords for repository
# NPM_CLONE_AUTO_INIT: auto initialize repository (0/1)
# NPM_CLONE_GITIGNORE_TEMPLATE: gitignore template for repository
# NPM_CLONE_LICENSE_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 NPM_CLONE_PREFIX=":+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)