An open API service indexing awesome lists of open source software.

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

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