+
Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.
/ alert Public archive

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

License

Notifications You must be signed in to change notification settings

zacanger/alert

Repository files navigation

alert-node

alert for Node.

Support with PayPal Patreon ko-fi

  • 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 -S alert-node

Usage:

import alert from 'alert-node'

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-node'
alert('hey!', 'yad')

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

LICENSE

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载