This package has been deprecated

Author message:

The package name alert-node has been deprecated. Please npm i alert instead.

alert-node
TypeScript icon, indicating that this package has built-in type declarations

5.0.3 • Public • Published

alert

Cross-platform, isomorphic alert, for Node and browser (previously alert-node)

Support with PayPal Patreon ko-fi

IMPORTANT this project was previously called alert-node. The package name changed in v4. Huge thanks to @iclanzan for the package name!

  • Uses window.alert in the browser.
  • Uses kdialog zenity, yad, notify-send, xmessage, dialog, or whiptail on Linux and BSD (depending on what's available).
  • Uses osascript/System Events on Mac.
  • Uses cscript on Windows (or msg if cscript fails).
  • Defaults to console.log.

Installation:

npm i alert

Usage:

import alert from 'alert'
 
alert('howdy')

If using the API, you can specify a program to use. This can be one of:

  • dialog (Linux)
  • kdialog (Linux)
  • notify-send (Linux)
  • whiptail (Linux)
  • xmessage (Linux)
  • yad (Linux)
  • zenity (Linux)
  • osascript (Mac)
  • cscript (Windows)
  • msg (Windows)
  • console (console.log)

Note that this will override any internal checks to get the correct program, and will blow up if you get it wrong. It's advised to just use the default behavior.

import alert from 'alert'
alert('hey!', 'yad')

alert also has a cli. npm i -g alert and run alert 'sup brah'.

To disable alert for testing purposes or otherwise, you can set an environment variable DISABLE_ALERT=1.

LICENSE

/alert-node/

    Package Sidebar

    Install

    npm i alert-node

    Weekly Downloads

    151

    Version

    5.0.3

    License

    LGPL-3.0

    Unpacked Size

    17.4 kB

    Total Files

    17

    Last publish

    Collaborators

    • zacanger