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

mozillians-client

v0.1.4

Published

Client library for mozillians.org

Downloads

2

Readme

Client Library for Mozillians.org (API v2)

Install with npm mozillians-client --save, and initialize as follows:

var Mozillians = require('mozillians-client');

var mozillians = new Mozillians('YOUR_API_KEY', {retries: 6});

mozillians.users({email: '...'}).then(function(result) {
  // Do something with result
}, function(err) {
  // Handle err
});

The module implements best practice REST API client principals such as:

  • Retries with exponential back-off,
  • Client side request, and
  • HTTPS keep-alive with default HTTPS agent.

For details on these options see the reference below or check out the source. Also refer to API documentation for more details on the options for the methods the the return value of the methods, all methods returns promises that should be easy to work with.

Reference

Install with npm mozillians-client --save, and load as Mozillians.

var Mozillians = require('mozillians-client');

Then you will have the following methods.

new Mozillians(apiKey, options)

Create new Mozillians client with given apiKey and options:

  • timeout, client side timeout,
  • hostname, alternative hostname in-place of 'mozillians.org',
  • agent, an https.Agent instance,
  • retries, max number of request retries,
  • delayFactor, factor by which delays between retries increase,
  • maxDelay, maximum delay between retries,
  • transientErrorCodes, error.codes for which requests are retried; these can be syscall errors like "ECONNRESET" or integer HTTP error codes like 503.

Mozillians#users(options)

Get users, given options:

  • is_vouched, boolean - Return only vouched/unvouched users
  • username, string - Return user with matching username
  • full_name, string - Return user with matching full name
  • ircname, string - Return user with matching ircname
  • email, string - Return user with matching primary/alternate email
  • country, string - Return users with matching country
  • region, string - Return users with matching region
  • city, string - Return users with matching city
  • page, integer - Return results contained in specific page
  • language, string - Return users speaking language matching language code
  • group, string - Return users who are members of given group name
  • skill, string - Return users with skill matching skill name

If a next or previous page is available the result object will have a nextPage() and previousPage() respectfully. Elements the results array will have a details() method returning further details if available.

Mozillians#groups(options)

Get groups, given options:

  • name, string - Return results matching given name
  • curator, integer - Return results matching given mozillians id
  • functional_area, true/false - only groups that are functional areas
  • members_can_leave, true/false - only groups with a members_can_leave policy
  • accepting_new_members, true/false - only groups with an accepting_new_members policy
  • page, integer - Return results contained in specific page

If a next or previous page is available the result object will have a nextPage() and previousPage() respectfully. Elements the results array will have a details() method returning further details if available.

Mozillians#skills(options)

Get skills, given options:

  • name, string - Return results matching given name
  • page, integer - Return results contained in specific page

If a next or previous page is available the result object will have a nextPage() and previousPage() respectfully. Elements the results array will have a details() method returning further details if available.

License

This module is released under MPL 2.0.