Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cli-error-notifier
Advanced tools
Send native desktop notifications when CLI apps fail
This little CLI comes in handy when writing build scripts.
Let’s imagine you have setup the following npm script for linting your JavaScript files:
{
"scripts": {
"eslint": "eslint build src",
}
}
With using cli-error-notifier you can simply get a desktop notification just when the linting fails:
{
"scripts": {
"eslint": "onerror \"eslint build src\"",
}
}
This is especially useful for watching files while developing. You could use it in conjunction with onchange like in the following example:
{
"scripts": {
"eslint": "eslint build src",
"eslint:fix": "npm run eslint --silent -- --fix",
"eslint:watch": "onchange \"src/**/*.js\" -- onerror \"npm run eslint --silent\""
}
}
It also works flawlessly together with npm-run-all.
$ npm install --global cli-error-notifier
It requires Node.js (v4 or greater).
$ onerror --help
Send native desktop notifications when CLI apps fail
Usage
$ onerror <command> [options]
Options
--title, -t The title of the notification
--message, -m The message body of the notification
--icon, -i Can be any absolute path
--sound, -s Use "mute" to disable default sound notification
Options are passed to the node-notifier CLI.
See https://github.com/mikaelbr/node-notifier-cli#usage
Detailed info about defaults can be found here:
https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults
Examples
$ onerror "wget unknown-host.xyz"
$ onerror "wget unknown-host.xyz" -s mute
$ onerror "wget unknown-host.xyz" -t Error -m "My error message"
$ onerror "wget unknown-host.xyz" -s Glass -i https://cdn.rawgit.com/npm/logos/31945b5c/npm%20square/n-64.png
This is using the brilliant node-notifier and therefore should work with Notification Center for macOS, notify-osd/libnotify-bin for Linux, Toasters for Windows 8/10, or taskbar Balloons for earlier Windows versions. Growl is used if none of these requirements are met.
MIT © Michael Kühnel
FAQs
Sends native desktop notifications if CLI apps fail
We found that cli-error-notifier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.