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

dev-notify

v1.0.5

Published

Lightweight developer notification tool for OTPs, errors, and events in local development.

Readme


dev-notify

Instant developer notifications for OTPs, errors, and events — right from Node.js.


Problem (what this solves)

During local development it is time-consuming and disruptive to verify runtime events:

  • You generate an OTP but must open Mailtrap → inspect the message to copy the code.
  • You debug an API that sends confirmation emails/SMS and have to query the database or mail provider to confirm delivery.
  • Long-running jobs or CI tasks finish but you only discover results by refreshing logs or terminal output.
  • In Docker/WSL environments native desktop notifications often fail silently, so you lose visibility.

Result: wasted context switches, slower feedback loops, and slower development/debug cycles.

dev-notify fixes this by delivering instant, developer-focused notifications (native desktop when available, console fallback otherwise) with an async, awaitable API that returns a status object you can persist or audit in your DB — just like nodemailer.sendMail() or SMS APIs do.


What it does (short)

  • Sends cross-platform native desktop notifications (via node-notifier).
  • Provides ergonomic shortcuts: success, error, info, warn.
  • Async Promise-based API that returns a structured NotifierResponse for tracking.
  • Safe console fallback when native notifications are unavailable (e.g., Docker, WSL).
  • Small, single-file dependency and easy to wire into existing dev tooling.

Install

npm install dev-notify
# or
yarn add dev-notify

Quick usage (TypeScript / JavaScript)

import notify from "dev-notify";

// Simple shortcut usage
const res = await notify.success("OTP: 123456");
console.log(res);

// Custom notification
const r = await notify.notify({
  title: "Custom Notification",
  message: "This is a custom message.",
  sound: true,
  wait: false,
});
console.log(r);

Example NotifierResponse:

// success
{
  success: true,
  backend: "desktop",       // or "fallback"
  response: "...",          // raw response from node-notifier (may vary)
  metadata: { /* platform metadata */ }
}

// failure
{
  success: false,
  backend: "fallback",      // console fallback used
  error: "Error message"
}

Track notification status in your DB

Because dev-notify returns a status object, you can persist notification attempts (for auditing or debugging), exactly as you would for emails/SMS.

Example: save the returned result to a DB

import notify from "dev-notify";

async function sendOtpAndLog(userId: string, otp: string) {
  const result = await notify.success(`OTP for ${userId}: ${otp}`);

  // Example DB save (pseudo)
  await db.notifications.insert({
    user_id: userId,
    title: "OTP",
    message: `OTP for ${userId}: ${otp}`,
    backend: result.backend,
    success: result.success,
    error: result.error || null,
    response: result.response ? JSON.stringify(result.response) : null,
    metadata: result.metadata ? JSON.stringify(result.metadata) : null,
    created_at: new Date(),
  });
}

API Reference

notify.notify(options: NotifyOptions): Promise<NotifierResponse>

Send a custom notification.

  • options.title: string (required)
  • options.message: string (required)
  • options.sound?: boolean (default true)
  • options.wait?: boolean (default false)

Shortcuts (all return Promise<NotifierResponse>)

  • notify.success(message: string)
  • notify.error(message: string)
  • notify.info(message: string)
  • notify.warn(message: string)

Environment & fallback behavior

  • Uses node-notifier under the hood:

    • macOS: native notification center
    • Windows: native toast notifications
    • Linux: notify-send (must be installed on many distros)
  • If native notification fails (no display server or missing binaries), the library:

    • Logs a clear prefixed fallback line to console (so nothing is silent).
    • Returns { success: false, backend: "fallback", error: "..." }.

Tip: In container/remote workflows, plan to use dev-notify-bridge.


Best practices

  • Use await and persist the returned object if you need a record of deliveries (recommended for reproducible debugging).
  • Keep notifications concise (title + short message); use console logging for verbose details.
  • For Docker/remote workflows, consider using dev-notify-bridge.

Why this package?

  • Reduces developer friction and context switching while verifying ephemeral runtime artifacts (OTPs, short-lived codes, job completions).
  • Matches the async, statusful patterns you already use for email/SMS APIs — enabling easy DB audit and consistent logging.

License

MIT © 2025