Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
git-clone-promises
Advanced tools
Promise wrapper for git-clone to clone repository via shell command
Promise version of jaz303's git-clone npm module. Clones a git repository via shell command and with promises!
Install:
$ npm install git-clone-promises
Require:
const { clone, cloneCallback } = require('git-clone-promises');
clone(repo, targetPath, [options=undefined])
Clones repo
to targetPath
, returning promise
Supported options
:
git
: path to git
binary; default: git
(optional).shallow
: when true
, clone with depth 1 (optional).checkout
: revision/branch/tag to check out (optional).remove
: removes targetPath if already existing (optional).Fullfills if done with no return value
Rejects if folder already exists and not empty and no remove
option or else failed to remove folder:
const { clone } = require('git-clone-promises');
clone('https://github.com/TheRolfFR/git-clone-promises.git', './test-clone', {
remove: true
}).then(() => {
console.log('complete!')
}).catch((err) => {
console.error(err)
})
I left callback version with my remove option addition:
const { cloneCallback } = require('git-clone-promises');
cloneCallback('https://github.com/TheRolfFR/git-clone-promises.git', './test-clone', {
remove: true
}, function (err) {
if(err)
console.error(err)
console.log('finished!')
})
© 2021 Le Vaguerès Yann
Twitter : @TheRolfFR
Website : therolf.fr
GitHub : @TheRolfFR
Released under the ISC license.
FAQs
Promise wrapper for git-clone to clone repository via shell command
The npm package git-clone-promises receives a total of 1 weekly downloads. As such, git-clone-promises popularity was classified as not popular.
We found that git-clone-promises demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.