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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dbpiper/slack-notify-status

v1.0.0-beta.2

Published

A module to send a slack message to a channel after a verification script is finished running.

Readme

slack-notify-status

Build Status npm version MIT license

A module to send a slack message to a channel after a verification script is finished running.

The basic idea is that you have a build and verification script, which may run for a long time. So in order to avoid wasting time just staring at the build script and waiting for it to finish, you can instead use this module and it will send a message to your slack channel when it is finished.

You can configure slack to send you notifications on your computer or phone, and now you've got an alert system for your build!

Installation instructions

npm install @dbpiper/slack-notify-status

Usage Instructions

(async () => {
  const slackNotifyStatus = new SlackNotifyStatus({
    slackUrl: 'hello',
    slackChannel: 'hello',
  });

  // do some work here

  const result = await slackNotifyStatus.slackSendMessage();
})();

API

new SlackNotifyStatus(options: SlackNotifyStatusOptions)

return type: SlackNotifyStatus

The instance object which is created to send the message, this has options which configure various aspects of the process. The only absolutely required ones are: the channel to post the message to and the slack url to use, the webhook url.

In order to use this application you need to setup your slack workspace to receive incoming webhooks, which requires making an application and giving it authorization to access your workspace.

SlackNotifyStatusOptions

interface SlackNotifyStatusOptions {
  slackUrl: string;
  slackChannel: string;
  timer?: Timer; // defaults to @dbpiper/timer
  scriptName?: string; // defaults to 'Verification'
}

SlackNotifyStatusOptions.slackUrl

The slack webhooks url for your authorized application, see new SlackNotifyStatus(options: SlackNotifyStatusOptions) for more information.

SlackNotifyStatusOptions.slackChannel

The Slack channel that you'd like the messages to be posted to.

SlackNotifyStatusOptions.timer

The timer you want to use to measure how long the code took to run, by default @dbpiper/timer is used. The API of the timer being used must match the @dbpiper/timer API.

The timer will start measuring from the moment that the instance object is created, by default. However, you may also use slackNotifyStatus.timer to get the instance of the timer and then you can manually start it when ready with timer.start. See @dbpiper/timer for more details on the timer API.

SlackNotifyStatusOptions.scriptName

The name of the script you are sending messages on behalf of, by default this is 'Verification', as this is the name of my script.


slackNotifyStatus.timer

return type: Timer

Gets the @dbpiper/timer instance object which is being used to measure the time. This can then be used to start the timer manually, which is useful if you want to create the SlackNotifyStatus instance object before you want to begin measuring the time taken. See @dbpiper/timer for more details on the timer API.

slackNotifyStatus.slackSendMessage(success = true, mock = false)

return type: Promise<string | Error>

This sends the message to slack. The success parameter indicates whether or not the script the message is being sent on behalf of was successful or not. In other words, if you are running a testing script and find an error in the tests, you should send it with success as false.

Mock is useful in cases when you are debugging something and happen to be running the script very frequently in these cases it can get quite annoying to get tons of slack notifications every few minutes. So instead you can simply set mock to true and no notifications will be sent. However, it should be noted that any code reviews should ensure that slack is not left true!

If there are no problems sending the message, or if it is mocked, then the Promise returned by slackSendMessage will be fulfilled with either a string, which will either include the message which was sent if it was not mocked, or a mocked message stating that it was a mock in this case.

If there are problems sending the message, then the promise will be rejected with an Error which is the error that prevented the sending of the message.

License

MIT Copyright © David Piper