1.0.0 • Published 11 years ago
clone-packages v1.0.0
clone-packages
clone packages from one npm registry to another, optionally recursively.
# in bash:
$ npm install -g clone-packages
$ clone-packages beefy browserify@3.x.x --to http://my.registry.us/ --recursive
# ... time passes and your modules are cloned!or programmatically:
var clone = require('clone-packages')
// grab this package:
clone('jsl@1.1.0', 'http://registry.npmjs.org/', 'http://my.reg/', done)
function done(err) {
// once cloning is complete
}API
clone(package, sourceRegistry, targetRegistry, options, ready)
package may be an object: {name: "packageName", version: "version"}, or a string: "package", "package@1.1.1".
sourceRegistry and targetRegistry must be strings representing URLs of the respective target registries.
options is an object allowing the following keys:
usernameused to authenticate in the publish step for the target registry.passwordused withusernameto authenticate.recursiveclone all dependencies ofpackageinternalizemove all packages with external dependencies into the target registry.loga function that will be called with every processed package.
ready is a callback that will be called once cloning has completed.
License
MIT