bz-json

0.1.1 • Public • Published

bz-json.js

A JavaScript wrapper for the Bugzilla JSON-RPC API.

install

For node install with npm:

npm install bz-json

and use with var bz = require("bz-json")

For the browser, build a browser file from the source code with browserbuild: browserbuild bz-json.js.

usage

var bugzilla = bz.createClient();
 
bugzilla.getBug(678223, function(error, bug) {
  if (!error) {
    alert(bug.summary);
  }
});

API

bz.createClient(options) creates a new Bugzilla API client, optionally takes options like the JSON-RPC API url and username + password:

var bugzilla = bz.createClient({
  url: "https://bugzilla.mozilla.org/jsonrpc.cgi",
  username: 'bugs@bugmail.com',
  password: 'secret'
});

Client methods

Each method takes a callback that takes an error message (if any kind of error occurs) as its first argument, and the expected return data as its second.

getBug(id, callback)
retrieves a bug given a bug id.

/bz-json/

    Package Sidebar

    Install

    npm i bz-json

    Weekly Downloads

    2

    Version

    0.1.1

    License

    none

    Last publish

    Collaborators

    • bpiec