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

commit-status

v4.3.0

Published

Simple command-line application to post commit status to GitHub (for use in CI)

Downloads

1,418

Readme

commit-status

A simple CLI tool to post commit statuses to GitHub from CI. Supports CircleCI, Travis CI, and Codeship.

About

At Taskworld, we want to have fine-grain status report for each commit. This is a perfect use case for GitHub’s commit status API.

Usage

Configure CI to expose GitHub access token

commit-status will look for GitHub access from these environment variables, in this order:

  • GH_STATUS_TOKEN
  • GH_TOKEN

That token should have repo:status scope.

You can create a bot account and obtain a token at https://github.com/settings/tokens/new.

Use with GitHub Enterprise

If you use GitHub Enterprise, then you can override the API endpoint by GITHUB_API environment variable.

env GITHUB_API=https://[hostname]/api/v3 commit-message ...

CLI

Install

Inside your CI deps script, install commit-status there:

npm install -g commit-status

Post commit status

Whenever you want to post a commit status from CI, invoke the command:

commit-status <state> <context> <description> [<url>]
  • state — Either pending, success, error, failure
  • context — “A string label to differentiate this status from the status of other systems.”
  • description — “A short description of the status.”
  • url — The URL to display.

Example CircleCI setup:

    - |
      if gulp lint
      then commit-status success lint/eslint "Linting successful."
      else commit-status failure lint/eslint "There are lint errors."
      fi

API

const commitStatus = require('commit-status')

commitStatus.post({
  state: 'success',
  context: 'lint/eslint',
  description: 'Linting successful.'
})