0.0.5 • Published 9 years ago

ghapi v0.0.5

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

github api (ghapi)

A github api for node and the browser.

Usage

npm install ghapi
var api = require('ghapi')
api(command, arg_1, ..., arg_n [, parameters, callback])

See commands.js for a list of all the commands. The file is compiled by scraping all the commands form the Github API documentation. Consult the Github documentation for parameters associated with each api call. For commands requiring authentication, append an auth object to parameters.

Create a new gist

POST /gists
api('createGist', parameters)
var files = { 
  'api.txt': { 
    content: 'hello!' 
  }
}
var basicAuth = { 
  user: 'user', 
  pass: 'pass' 
}
api('createGist', { files: files, auth: basicAuth }).pipe(process.stdout);

Fork a gist

POST /gists/:id/forks
api('createGistFork', id, parameters);
var bearerAuth = { bearer: 'access token' } // github access token
api('createGistFork', '1',  { auth: bearerAuth }, function (err, res, body) {
  console.log(body);
});

Todo

  • Add tests and documentation
0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago