# winotify

> A package for emitting simple toast notifications in Windows.

Latest version **1.0.4** (published 2024-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install winotify
pnpm add winotify
yarn add winotify
bun add winotify
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-01-14 |
| First published | 2023-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tomás Luchesi |
| Maintainers | no_mad |

## Links

- npm: https://www.npmjs.com/package/winotify
- npm.io page: https://npm.io/package/winotify

## Recent versions

- 1.0.4 (latest) — 2024-01-14
- 1.0.2 — 2023-07-16
- 1.0.1 — 2023-07-16
- 1.0.0 — 2023-07-16

## README

# Winotify

This is a small package for easily redering toast notifications in Windows.
It is zero-dependency, based only on a series of PowerShell commands.

## Usage:

```
const Notification = require('winotifier');
const n = new Notification();
```

### API Methods:

```
.setType(string: value): this

> Sets the base icon type on notification.
> Possible options for 'value' are listed in property 'TipIcons':
    > None
    > Info
    > Error
    > Warning
> Returns the own Notification instance, so methods can be chained.
> Throws a '<invalid_icontype>' custom error if types are not compatible.
```
```
.setText(string: value): this

> Sets the base text on notification.
> Returns the own Notification instance, so methods can be chained.
> Throws a '<invalid_string>' custom error if types are not compatible.
```
```
.setTitle(string: value): this

> Sets the base title on notification.
> Returns the own Notification instance, so methods can be chained.
> Throws a '<invalid_string>' custom error if types are not compatible.
```
```
.setIcon(string: value): this

> Sets the base app icon on notification - string must be a valid icon file path.
> Returns the own Notification instance, so methods can be chained.
> Throws a '<invalid_iconfile>' custom error if types are not compatible.
> Only '.ico' files are compatible.
```
```
.setDisplayTime(number: value): this

> Sets the timeout for the notification display.
> Returns the own Notification instance, so methods can be chained.
> Throws a '<invalid_number>' custom error if types are not compatible.
> Defaults to 5000 ms.
```
```
.render(): this

> Renders the notification using the predefinde configs.
> Prints stdout, stderr, and errors if any of them is valid.
> Throws a '<invalid_instance>' custom error if a fatal error occurs.
```

### API Properties

```
.TipIcons

> Contains the names of the valid icon types for notifications:
    static TipIcons = { 
        'None':'None',
        'Info':'Info',
        'Error':'Error',
        'Warning':'Warning'  
    };
```

### Example Usage:

```
// Configures and renders a 'Warning' notification
const Notification = require('winotify');
const n = new Notification()
    .setType('Warning')
    .setTitle('This is a title')
    .setText('This is a text')
    .setIcon('C:\\somefolder\\somefile.ico')
    .render()
;
```

---
_Source: https://npm.io/package/winotify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
