Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mozillians-client

Package Overview
Dependencies
Maintainers
11
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mozillians-client

Client library for mozillians.org

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
11
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 11 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc