Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

nodegit-kit

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodegit-kit

NodeGit-Kit -----------

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
477
84.88%
Maintainers
1
Weekly downloads
 
Created
Source

NodeGit-Kit

An incomplete set of NodeGit helper promises. Please don't use this in production yet.

Comments are welcome: https://github.com/thisconnect/nodegit-kit/issues

var kit = require('nodegit-kit');

var open = kit.open;
var commit = kit.commit;
var diff = kit.diff;
var log = kit.log;
var status = kit.status;

open('../repo-path/new/or/existing')
.then(function(repo){
    return repo;
})
.then(function(repo){
     // git diff
    return diff(repo)
    .then(function(diff){
        // console.log(diff);
        return repo;
    });
})
.then(function(repo){
    // git commit -am"commit message"
    return commit(repo, {
        'message': 'commit message'
    });
})
.then(function(repo){
    // git log
    return log(repo);
})
.then(function(log){
    // console.log(log);
})
.catch(function(error){
    console.error(error.stack);
});

git status

open('../repo-path/new/or/existing')
.then(function(repo){
     // git status
    return status(repo)
    .then(function(status){
       console.log(status);
       return repo;
    })
})

git config

This is optional, if not configured, config tries to read your global git config.

var kit = require('nodegit-kit');

var config = kit.config;

config.set({
    'user': {
        'name': 'username',
        'email': 'user@localhost'
    }
});

Example

npm test

NodeGit-Kit example log

FAQs

Package last updated on 05 Sep 2015

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