Node Notifier CLI

2.0.0 · maintenance · verified Wed Apr 22

node-notifier-cli is a command-line interface (CLI) package that provides a convenient way to send cross-platform desktop notifications. It acts as a wrapper around the `node-notifier` library, enabling users to trigger notifications directly from their terminal or shell scripts without writing JavaScript code. It supports various notification systems including macOS Notification Center (since 10.8), Windows Toast notifications, Growl, and `notify-send` for Linux. Version 2.0.0 is the current stable release, with its last major update occurring approximately five years ago. Its release cadence is closely tied to its underlying `node-notifier` library, which provides the core notification functionality. The package differentiates itself from programmatic notification libraries by offering a simple, unified command-line syntax for sending messages, titles, icons, and even opening URLs on click, focusing solely on CLI usability.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates global installation and various ways to send desktop notifications, including titles, messages, sounds, custom icons, opening URLs, and piping input.

# Install globally (recommended for CLI usage)
npm i -g node-notifier-cli

# Basic notification
notify -t 'Hello World' -m 'This is a test notification from the CLI.'

# Notification with sound and opening a URL on click
notify -t 'GitHub Update' -m 'New pull request on your repository!' -s Basso --open 'https://github.com/mikaelbr/node-notifier-cli'

# Notification with a custom icon
notify -t 'Agent Coulson' --icon 'https://raw.githubusercontent.com/mikaelbr/node-notifier/master/example/coulson.jpg' -m 'I know, right?'

# Pipe content to message
echo "This message comes from stdin!" | notify -t "Piped Message"

view raw JSON →