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

landing-strip

v2.0.3

Published

slack bot that notifies you when new versions of a module land

Downloads

4

Readme

landing-strip

Current Version Build Status via Travis CI Dependencies devDependencies

Slack bot that notifies you when new versions of a module land in npm. Creating a landing strip is as simple as running a file from the examples directory. For example, to receive notifications when any of the hapi repos are published to npm, simply run node examples/hapi.

LandingStrip(options)

The contents of examples/hapi are shown below. The LandingStrip() function uses the npm-publish-stream module to detect npm publish events. The filter property, if present, is used to determine which events are published to Slack. In this case, hapi modules are detected based on their repository URL.

var Hoek = require('hoek');
var LandingStrip = require('../');

LandingStrip({
  username: 'hapijs-bot',
  emoji: ':hapi:',
  hook: 'https://hooks.slack.com/services/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',
  startTime: new Date(Date.now() - (1000 * 60 * 60 * 24 * 2)), // two days in the past
  onError: function(err) {
    console.error(err);
  },
  filter: function(data) {
    var repo = Hoek.reach(data, 'doc.repository.url', {default: ''});

    return /\/\/github\.com\/hapijs\//.test(repo);
  }
});

username Option (string)

This is a string that specifies the username that is displayed in Slack when a message is posted. In the hapi example, posts are shown to be from hapijs-bot.

emoji Option (string)

This is a string specifying the emoji that is displayed as the username avatar. The hapi example uses a custom :hapi: emoji, which must be present in your Slack.

hook Option (string)

This is a string specifying the URL of the Slack incoming web hook.

filter Option (array or function) (optional)

filter determines which npm publish events are turned into Slack notifications. If filter is not present, all npm publish events are shown in Slack. If filter is an array, only modules whose names are included in the array are displayed in Slack (see examples/hapi-array for an example). If filter is a function, then each data event from the npm publish stream is passed to this function. If the function returns true, then the event is translated into a Slack notification.

startTime Option (Date) (optional)

If present, startTime should be a Date object that specifies the earliest npm publish time that should show up in the event stream. If startTime is not specified, it defaults to the current time. In the hapi example, Landing Strip creates notifications for npm publish events as far as two days in the past.

onError Option (function) (optional)

If present onError should be a function that is used to handle errors. The error is passed as the only argument to this function. If onError is not specified, a noop function is used. In the hapi example, all errors simply logged using console.error().