New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simple-git-promise

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-git-promise

DEPRECATED: this is just a 1 line wrapper around cmd-executor. You should probably just use that instead

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
1
Created
Source

simple-git-promise

DEPRECATED: This is just a 1-line wrapper around cmd-executor. You should probably just use that instead.

Installation

npm i simple-git-promise -S

Usage

const git = require('simple-git-promise')
 
// All calls return a promise, so you should probably wait for them to complete 
// before running another command. You could use `.then()` or `await` 
;(async () => {
 
  // There are no specific attributes or functions defined on `git`. 
  // Instead, it is a proxy object that will take all attributes/function calls and 
  // parse them into a git command. For example: 
 
  // will run `git init` 
  await git.init()
 
  // will run `git add .` 
  await git.add('.')
 
  // will run `git commit -m "initial commit"` 
  await git.commit('-m "initial commit"')
 
  // will run `git remote add origin git@github.com:renolc/simple-git-promise.git` 
  await git.remote.add('origin', 'git@github.com:renolc/simple-git-promise.git')
 
  // Text that would be output by the git CLI are resolved by the promise 
  await git.branch('newBranch')
  const msg = await git.checkout('newBranch')
  console.log(msg) // "Switched to branch 'newBranch'\n" 
 
  // Finally, since what you can call on `git` is unbound, you could 
  // certainly do something nonsensical like: 
  try {
    await git.bork.blarg(42) // will try to run `git bork blarg 42` 
  } catch (e) {
    console.log(e) // error message containing "git: 'bork' is not a git command. See 'git --help'" 
  }
 
})()

Keywords

simple

FAQs

Package last updated on 26 Feb 2017

Did you know?

Socket

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.

Install

Related posts