Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-nodegit

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-nodegit

a high level wrapper for nodegit with simple and elegant API

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

easy-nodegit

A simple and elegant git client base on nodegit.

install

npm install easy-nodegit --save

Usage

Simple git client API, just like using git command:

const GitClient = require('easy-nodegit')
const client = new GitClient('/path/to/repo/work/directory', {
  type: 'ssh',                        // support 'ssh' or 'http', default is 'ssh'
  // when type == 'ssh'
  privateKey: '/path/to/privateKey',  // default is ~/.ssh/id_rsa
  publicKey: '/path/to/publicKey'     // default is ~/.ssh/id_rsa.pub
  // when type == 'http'
  username: '...',
  password: '...'
})

async function test () {
  // clone
  await client.clone('git@github.com:yibn2008/easy-nodegit.git')

  // add
  await client.add([
    'index.js',
    'index.css'
  ])
  await client.add('lib/**/*.js')

  // reset
  await client.reset('index.*')

  // remove
  await client.remove('lib/modules/*')

  // commit
  await client.commit('commit message')

  // pull
  await client.pull()

  // push
  await client.push()
}

test().catch(err => {
  console.error(err)
})

API

see API.md

LICENSE

MIT

Keywords

FAQs

Package last updated on 09 Aug 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc