jjimenezlopez / node-gitlab

gitlab api nodejs library

Home Page:https://npmjs.org/package/gitlab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-gitlab

Build Status (Travis) Dependency Status authors library users Total views Views in the last 24 hours Bitdeli Badge

NPM Badge

GitLab API Nodejs library. It wraps the HTTP api library described here.

Maintained by Manfred Touron and Dave Irvine

Install

# Install from npm
npm install gitlab

Usage

URL to your GitLab instance should not include /api/v3 path.

Coffee-Script

# Connection
gitlab = (require 'gitlab')
  url:   'http://example.com'
  token: 'abcdefghij123456'

# Listing users
gitlab.users.all (users) ->
  console.log "##{user.id}: #{user.email}, #{user.name}, #{user.created_at}" for user in users

# Listing projects
gitlab.projects.all (projects) ->
  for project in projects
    console.log "##{project.id}: #{project.name}, path: #{project.path}, default_branch: #{project.default_branch}, private: #{project.private}, owner: #{project.owner.name} (#{project.owner.email}), date: #{project.created_at}"

Javascript

// Connection
var gitlab = require('gitlab')({
  url:   'http://example.com',
  token: 'abcdefghij123456'
});

// Listing users
gitlab.users.all(function(users) {
  for (var i = 0; i < users.length; i++) {
    console.log("#" + users[i].id + ": " + users[i].email + ", " + users[i].name + ", " + users[i].created_at);
  }
});

// Listing projects
gitlab.projects.all(function(projects) {
  for (var i = 0; i < projects.length; i++) {
    console.log("#" + projects[i].id + ": " + projects[i].name + ", path: " + projects[i].path + ", default_branch: " + projects[i].default_branch + ", private: " + projects[i]["private"] + ", owner: " + projects[i].owner.name + " (" + projects[i].owner.email + "), date: " + projects[i].created_at);
  }
});

See Examples directory for more examples

Develop

Gitter chat

Edit the Coffee-Script files in src, then build them using cake build. Use cake watch to build files continuously while developing.

CLI

Check out cli-gitlab

Contributors

License

MIT

Changelog

1.2.0 (2014-12-24)

  • Switched to new organization, some urls changed
  • Improve development tools
  • Cleaned code
  • Changed AddHook parameters
  • Happy Christmas

1.1.0 (2014-11-04)

  • Added project branch support
  • Improved compatibility with API
  • Improved global error handling
  • Rebuilt javascript using latest Coffee-Script

1.0.0 (2014-08-19)

  • Not fully stable, need more tests
  • Now we have a CHANGELOG

About

gitlab api nodejs library

https://npmjs.org/package/gitlab


Languages

Language:CoffeeScript 98.9%Language:Makefile 1.1%