cross-alert is a cross-platform alert function library supporting Windows, Web, Linux, and macOS, with additional support for Bun. This library allows you to display alert messages in a consistent manner across different environments.
You can install cross-alert via npm:
npm install cross-alertimport { alert } from 'cross-alert'
// Show an alert message
await alert('This is an alert message!')
// Or optionally specify a title
await alert('This is an alert message!', { title: 'Alert' })- Windows: Uses
MessageBox - Web: Uses
window.alert - Linux: Uses
zenity,kdialog, orxmessage. You may need to install these tools if they are not already present on your system. - macOS: Uses
osascript
To build the project, use:
npm run buildContributions are welcome! Please open an issue or submit a pull request to the development branch.