Clone multiple git repositories.
$ npm i --save git-cloner
const gitCloner = require("git-cloner");
gitCloner([
"IonicaBizau/git-stats"
, {
source: "IonicaBizau/node-cobol#1.5.0"
, path: "a/bridge/to/1959"
}
], `${__dirname}/clones`, (err, data) => {
console.log(err || data);
});
Clones the git repositories specified in the input
parameter.
-
Array
input
: An array of git sources: git urls (it also supports owner/repo notation, parsed bygit-source
), or objects in this format: -
source
(String): The source of the git repository. -
path
(String): The custom folder name/path where the repository should be cloned. -
Object
options
: An object containing the following fields: -
dest
(String): The folder where to clone the repositories (default:"."
) -
urlType
(String): The git url type (default:"ssh"
). -
showOutput
(Boolean): Iftrue
, the child process output streams will be piped in the main process. -
done
(Function): A function to be called after each repo was cloned. -
parallelLimit
(Number): A number representing the max count of git cloning processes in the same time (default:5
). -
Function
cb
: The callback function.
Have an idea? Found a bug? See how to contribute.
If you are using this library in one of your projects, add it in this list. ✨
git-module-installer
—Clone git repositories and install their npm dependencies.