https://github.com/bph/pauli-alerts
An exercise for NodeCLI course
https://github.com/bph/pauli-alerts
Last synced: 11 months ago
JSON representation
An exercise for NodeCLI course
- Host: GitHub
- URL: https://github.com/bph/pauli-alerts
- Owner: bph
- License: mit
- Created: 2020-11-17T21:56:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-28T03:20:04.000Z (over 5 years ago)
- Last Synced: 2025-08-17T08:24:01.352Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
README
# pauli-alerts
Cross platform CLI Alerts with colors & colored symbols for success, info, warning, error. Work on macOS, Linux, and Windows.
## Install
```
npm install pauli-alerts
```
## Usage
```js
const alert = requires('pauli-alerts');
// Prodvide the type, ms, and name options
alert({ type: "success", msg: "All done!", name: `Done`});
// Prints: ✔ Done All done!
alert({ type: "warning", msg: "Tomorrow it's going to be hot. Get up early!",});
// Prints: ⚠ WARNING Tomorrow it's going to be hot. Get up early!
alert({ type: "info", msg: "No Hurricanes in the Gulf of Mexico",});
// Prints: ℹ INFO No Hurricanes in the Gulf of Mexico
alert({ type: "error", msg: "Oops that doesn't work. ",name: `Mistake!`});
//Prints: ✖ Mistake! Oops that doesn't work.
```
## API
### alert(options)
#### > options
Type: object
Default {}
You can specify the options below.
#### > type
Type: string
Default: error
#### > msg
Type: string
Default: You forgot to define all options.
#### > name
Type: string
Default: ''
## Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](code_of_conduct.md). By participating in this project you agree to abide by its terms.
## History
This is an example project of the NodeJS CLI course by Ahmad Awais