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

rollodeqc-gh-utils

v1.0.0

Published

RoLLodeQc GitHub utilities.

Downloads

22

Readme

rollodeqc-gh-utils

Build Status Coverage Status Dependency Status

RoLLodeQc GitHub utilities.

Install

$ npm install --save rollodeqc-gh-utils

Usage

const rollodeqcGhUtils = require('rollodeqc-gh-utils')

rollodeqcGhUtils.rateLimit().then((result) => {
  console.log(JSON.stringify(result, null, ' '))
})
//=>
{
 "rate": {
  "limit": 5000,
  "remaining": 5000,
  "reset": 1459470151
 },
 "headers": {
  "server": "GitHub.com",
  "date": "Thu, 31 Mar 2016 23:22:31 GMT",
  "status": "200 OK",
  "x-ratelimit-limit": 5000,
  "x-ratelimit-remaining": 5000,
  "x-ratelimit-reset": 1459470151,
  "timestamp": 1459466551,
  "timestampDiff": 2.87,
  "statusCode": 200
 }
}

API

rollodeqcGhUtils.got(url[, obj])

Fetch json documents from GitHub. Like ghGot with a little sugar added. Only some headers are kept and parsed.

Returns a promise.

url

Type: string

obj

Type: object Default: {}

See ghGot. Good for token, etc. Note that the token can be overridden globally with the GITHUB_TOKEN environment variable.

rollodeqcGhUtils.rateLimit()

Fetch current rate limit and return a promise.

rollodeqcGhUtils.links(result)

Parses result.headers.link and returns an object with next, previous and last links.

result

Type: object

rollodeqcGhUtils.wait(result)

Return time to wait (in ms) between calls to got() to respect the rate limit.

result

Type: object

rollodeqcGhUtils.chosenHeaders(headers)

Lorem ipsum.

headers

Type: object

rollodeqcGhUtils.chosenFields(fields)

Lorem ipsum.

fields

Type: object

Dependencies

  • gh-got
  • lodash.pickby
  • lodash.omitby
  • lodash.flow
  • lodash.partial

License

AGPL-v3 © Robin Millette