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

@wasserstoff/notification-system

v0.0.3

Published

A flexible and extensible TypeScript-based notification system supporting multiple channels including Gmail, Twilio SMS, and desktop notifications.

Downloads

5

Readme

@wasserstoff/notification-system

GitHub

A flexible and extensible TypeScript-based notification system that supports multiple notification channels including Gmail, Twilio SMS, and desktop notifications.

Features

  • Multiple Notification Channels:
    • 📧 Gmail Email Notifications
    • 📱 Twilio SMS Notifications
    • 💻 Desktop Notifications
  • TypeScript Support: Built with TypeScript for type safety and better development experience
  • Easy to Extend: Implement the ISender interface to add new notification channels
  • Simple API: Consistent interface across all notification methods

Quick Start

  1. Install the package and its peer dependencies:

    npm install @wstf/notification-system dotenv node-notifier nodemailer twilio
  2. Create a .env file in your project root with your credentials (see Configuration below).

  3. Start sending notifications:

    import { GmailSender, TwilioSMSSender, DesktopNotifier } from '@wstf/notification-system';
    import 'dotenv/config';
    
    // Initialize senders
    const gmail = new GmailSender(process.env.GMAIL_USER!, process.env.GMAIL_PASS!);
    const sms = new TwilioSMSSender(process.env.TWILIO_SID!, process.env.TWILIO_TOKEN!, process.env.TWILIO_FROM!);
    const desktop = new DesktopNotifier('MyApp');
    
    // Send notifications
    async function sendNotifications() {
      const message = 'Hello from Notification System!';
         
      await gmail.send(message);
      await sms.send(message);
      await desktop.send(message);
    }
    
    sendNotifications().catch(console.error);

Installation

npm install @wstf/notification-system

Peer Dependencies

This package requires the following peer dependencies which you'll need to install separately:

npm install dotenv node-notifier nodemailer twilio

Configuration

Create a .env file in your project root with the following variables:

# Gmail Configuration
[email protected]
GMAIL_PASS=your-app-specific-password  # Use App Password for 2FA accounts

# Twilio Configuration
TWILIO_SID=your-account-sid
TWILIO_TOKEN=your-auth-token
TWILIO_FROM=your-twilio-phone-number  # Format: +1234567890

Note: For Gmail, you may need to generate an App Password if you have 2FA enabled on your Google account.

Usage

Basic Usage

import { GmailSender, TwilioSMSSender, DesktopNotifier } from '@wstf/notification-system';
import 'dotenv/config';

// Initialize senders
const gmail = new GmailSender(process.env.GMAIL_USER!, process.env.GMAIL_PASS!);
const sms = new TwilioSMSSender(process.env.TWILIO_SID!, process.env.TWILIO_TOKEN!, process.env.TWILIO_FROM!);
const desktop = new DesktopNotifier('MyApp');

// Send notifications
async function sendNotifications() {
  const message = 'Hello from Notification System!';
  
  await gmail.send(message);
  await sms.send(message);
  await desktop.send(message);
}

sendNotifications().catch(console.error);

Available Senders

1. Gmail Sender

const gmail = new GmailSender(email: string, password: string);
await gmail.send('Your email message here');

2. Twilio SMS Sender

const sms = new TwilioSMSSender(accountSid: string, authToken: string, fromNumber: string);
await sms.send('Your SMS message here');

3. Desktop Notifier

const desktop = new DesktopNotifier(title?: string);
await desktop.send('Your desktop notification here');

Extending the System

You can easily add new notification channels by implementing the ISender interface:

import { ISender } from '@wstf/notification-system';

export class MyCustomSender implements ISender {
  async send(content: string): Promise<void> {
    // Implement your custom notification logic here
    console.log('Sending notification:', content);
  }
}

Error Handling

Each sender implements error handling specific to its notification channel. Errors are propagated up to the caller, so make sure to handle them appropriately:

try {
  await sms.send('Important message!');
} catch (error) {
  console.error('Failed to send SMS:', error);
  // Handle error or fallback to another notification method
}

Security Considerations

  • Gmail: Use an App Password instead of your main Google account password
  • Twilio: Keep your Auth Token and Account SID secure
  • Environment Variables: Never commit your .env file to version control

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

ISC © 2023