npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@eliperelman/bz

v1.0.1

Published

Bugzilla REST API wrapper

Downloads

4

Readme

bz.js!

Build Status

A JavaScript wrapper for the Bugzilla REST API.

Warning!!!

Although Travis tests are now working, test coverage is far from complete. Please report issues especially if you find problems running bz.js in the browser. Worst case scenario, please revert to 0.3 as it still basically works.

Install

For node install with npm:

npm install bz

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

For the browser, download the latest from https://unpkg.com/bz

Development

  1. git clone [email protected]:canuckistani/bz.js.git
  2. cd ./bz.js
  3. npm install

Builds

  • npm run build - this will build node and browser files from the ./src directory. The node main entry points to ./build.

Tests

Some tests are included. If you want to run the tests, you can do so with npm test.

Usage

var bugzilla = bz.createClient();

bugzilla
  .getBug(678223)
  .then(bug => {
    console.log(bug.summary);
  });

API

bz.createClient(options) creates a new Bugzilla API client, optionally takes options like the REST API url, username + password or apiKey:

var bugzilla = bz.createClient({
  url: 'https://api-dev.bugzilla.mozilla.org/rest/',
  username: '[email protected]',
  password: 'secret'
});
var bugzilla = bz.createClient({
  url: 'https://api-dev.bugzilla.mozilla.org/rest/',
  apiKey: '23dsf3423s',
  timeout: 30000
});

See docs on the login endpoint.

Client methods

Each method returns a Promise so you can await on the data or catch any errors.

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

searchBugs(searchParams)
searches with given search parameters and fetches an array of bugs.

countBugs(searchParams)
searches with given search parameters and gets a integer count of bugs matching that query. this is not supported currently.

createBug(bug)
creates a bug and returns the id of the newly created bug.

updateBug(id, bug)
updates a bug with new bug info.

bugComments(id)
retrieves the comments for a bug.

addComment(id, comment)
adds a comment to a bug.

bugHistory(id)
retrieves array of changes for a bug.

bugFlags(id)
retrieves array of flags for a bug.

bugAttachments(id)
retrieves array of attachments for a bug.

createAttachment(bugId, attachment)
creates an attachment on a bug, and returns the id of the newly created attachment.

getAttachment(attachId)
gets an attachment given an attachment id.

updateAttachment(attachId, attachment)
updates the attachment.

searchUsers(match)
searches for users by string, matching against users' names or real names.

getUser(userId)
retrieves a user given a user id.

getSuggestedReviewers(id)
retrieves a list of suggested reviewers for a bug.

getConfiguration(options)
gets the configuration of this Bugzilla server. Note: this only works currently against Mozilla's production instance, the bugzilla 5.0 instance running on landfill has no equivalent call that can be run from the browser due to a lack of CORS headers.