🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

reliable-git

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reliable-git

reliable-git

0.1.4
latest
Source
npm
Version published
Weekly downloads
6
20%
Maintainers
3
Weekly downloads
 
Created
Source

reliable-git

NPM version build status Test coverage node version npm download

reliable git

Installment

$ npm i reliable-git --save

Usage

var reliableGit = require('reliable-git');
var options = {
  repo: 'https://github.com/reliablejs/reliable-git',
  dir: 'tmp/reliable-git'
};

/**
 * node pattern error-first callback
 */

reliableGit.clone(options, function(err, result) {
  if (err) {
    console.log(err);
    return;
  }
  // result is an Repo instance 
  console.log(result);

  // you can get latest commit info
  result.latestCommitInfo(function(err, info) {
    /** latestCommitInfo is an object 
     * commitId: 87d0e4e,
     * author: ziczhu,
     * date: Tue Aug 25 17:10:58 2015 +0800,
     * subject: fix missing,
     * branch: master
    */
    console.log(info);
  });
});

/**
 * use in co v4
 */

co(function *() {
  try {
    // result is an Repo instance
    var result = yield reliableGit.clone(options); 
    console.log(result);

    // you can get latest commit info
    var info = yield result.latestCommitInfo();
    /** latestCommitInfo is an object 
     * commitId: 87d0e4e,
     * author: ziczhu,
     * date: Tue Aug 25 17:10:58 2015 +0800,
     * subject: fix missing,
     * branch: master
    */
    console.log(info);
  } catch(e) {
    console.log(e);
  }
});

/**
 * use as a promise
 */

reliableGit.clone(options)
  .then(function(result) {
    // result is an Repo instance
	  console.log(result);

    // you can get latest commit info
    result.then(function(info) {
    /** latestCommitInfo is an object 
     * commitId: 87d0e4e,
     * author: ziczhu,
     * date: Tue Aug 25 17:10:58 2015 +0800,
     * subject: fix missing,
     * branch: master
      */
      console.log(info);
    });
  });

License

The MIT License (MIT)

Keywords

reliable

FAQs

Package last updated on 18 Sep 2016

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