All Projects → micromata → Cli Error Notifier

micromata / Cli Error Notifier

Licence: mit
Sends native desktop notifications if CLI apps fail

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Cli Error Notifier

Nps
NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
Stars: ✭ 1,285 (+2006.56%)
Mutual labels:  npm-scripts, cli
Npm Run All
A CLI tool to run multiple npm-scripts in parallel or sequential.
Stars: ✭ 4,496 (+7270.49%)
Mutual labels:  npm-scripts, cli
loggin-js
📝 Customizable and expandable logger for Node.js
Stars: ✭ 20 (-67.21%)
Mutual labels:  notifier, node-js
Discordrpcmaker
Cross-platform Discord Rich Presence Maker, WITH BUTTONS!
Stars: ✭ 165 (+170.49%)
Mutual labels:  cli, node-js
Snoo
A Reddit command line client written in Node.js, using modern ES-features
Stars: ✭ 39 (-36.07%)
Mutual labels:  cli, node-js
Redrun
✨🐌 🐎✨ fastest npm scripts runner
Stars: ✭ 85 (+39.34%)
Mutual labels:  npm-scripts, cli
Teachcode
A tool to develop and improve a student’s programming skills by introducing the earliest lessons of coding.
Stars: ✭ 325 (+432.79%)
Mutual labels:  cli, node-js
Nodejs Master Class
🛠 This repository contains the homework assignment for Node.js Master Class that is focused on building a RESTful API, web app GUI, and a CLI in plain Node JS with no NPM or 3rd-party libraries
Stars: ✭ 182 (+198.36%)
Mutual labels:  cli, node-js
Yarpm
CLI tool to run npm scripts with either npm or yarn, depending on how it was started
Stars: ✭ 13 (-78.69%)
Mutual labels:  npm-scripts, cli
Worker Threads Nodejs
Benchmark nodeJS worker threads for calculating prime numbers, using various dataStructures
Stars: ✭ 27 (-55.74%)
Mutual labels:  cli, node-js
Forge Node App
🛠📦🎉 Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (+47.54%)
Mutual labels:  cli, node-js
Pdfsave
Convert websites into readable PDFs
Stars: ✭ 46 (-24.59%)
Mutual labels:  cli, node-js
Caporal.js
A full-featured framework for building command line applications (cli) with node.js
Stars: ✭ 3,279 (+5275.41%)
Mutual labels:  cli, node-js
Solidarity
Solidarity is an environment checker for project dependencies across multiple machines.
Stars: ✭ 540 (+785.25%)
Mutual labels:  cli, node-js
Nls
Missing inspector for npm packages.
Stars: ✭ 44 (-27.87%)
Mutual labels:  npm-scripts, cli
Bugsnag Node
[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 48 (-21.31%)
Mutual labels:  error-handling, node-js
Cheatsheet
Cool command-line cheatsheet. Open format, grep-able, where you need them most.
Stars: ✭ 58 (-4.92%)
Mutual labels:  cli
Php Fpm Status Cli
PHP-FPM status-page CLI
Stars: ✭ 60 (-1.64%)
Mutual labels:  cli
Awless Templates
Repository of examples for awless templates (see https://github.com/wallix/awless)
Stars: ✭ 59 (-3.28%)
Mutual labels:  cli
Go Errortree
Go library for handling errors organized as a tree
Stars: ✭ 59 (-3.28%)
Mutual labels:  error-handling

npm version Build Status Coverage devDependency Status Dependency Status

cli-error-notifier

Sends native desktop notifications if CLI apps fail

Technically: if a command exits with an exit code other than 0

Install

To use it in your project:

$ npm install --save-dev cli-error-notifier

To use it globally:

$ npm install --global cli-error-notifier

It requires Node.js (v4 or greater).

General usage

$ onerror --help

  Sends native desktop notifications if CLI apps fail

	Usage
	  $ onerror <command> [options]

	Options
	  --title,   -t   Sets the title of the notification.
	                  Default: "An error has occured"
	  --message, -m   Sets the message body of the notification.
	                  Default: "Check the terminal for more information"
	  --icon,    -i   Sets an icon. Can be any absolute path.
	  --sound,   -s   Defines which sound to use.
	                  Use "mute" to disable default sound notification.
	                  Options: Mute, Basso, Blow, Bottle, Frog, Funk, Glass, Hero,
	                           Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink
	                  Default: Bottle
	  --version  -v   Displays the version number.
	  --help     -h   Displays the help.

	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

Usage with npm scripts

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 src",
  }
}

With using cli-error-notifier a desktop notification can be generated at the moment the linting fails:

{
  "scripts": {
    "eslint": "onerror \"eslint 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 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.

Cross platform compatibility

cli-error-notifier uses 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.

Related

  • onchange - Watch files and folders and run a command when anything is changed.
  • npm-run-all - CLI tool to run multiple npm-scripts in parallel or serial.

License

MIT © Michael Kühnel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].