🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

alert

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alert

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

5.1.0
Source
npm
Version published
Weekly downloads
997
-13.53%
Maintainers
1
Weekly downloads
 
Created
Source

alert

DEPRECATED

I highly recommend using node-notifier or node-notifier-cli rather than this project; they're better tested, maintained, and more featureful.

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

Keywords

alert

FAQs

Package last updated on 29 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts