# @wok-cli/plugin-notifier

> Build status notifier for Wok

Latest version **1.0.2** (published 2020-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wok-cli/plugin-notifier
pnpm add @wok-cli/plugin-notifier
yarn add @wok-cli/plugin-notifier
bun add @wok-cli/plugin-notifier
```

## 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.2 |
| Published | 2020-01-07 |
| First published | 2019-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Marco Solazzi |
| Maintainers | dwightjack |

## Links

- npm: https://www.npmjs.com/package/@wok-cli/plugin-notifier
- Repository: https://github.com/dwightjack/wok-pkgs
- Homepage: https://github.com/dwightjack/wok-pkgs#readme
- Issues: https://github.com/dwightjack/wok-pkgs/issues
- npm.io page: https://npm.io/package/@wok-cli/plugin-notifier

## Dependencies (1)

- [node-notifier](https://npm.io/package/node-notifier.md) ^6.0.0

## Recent versions

- 1.0.2 (latest) — 2020-01-07
- 1.0.1 — 2019-12-19

## README

# Wok Notifier Plugin

Implements build status notification via [node-notifier](https://www.npmjs.com/package/node-notifier).

| Hook types | Production only | Purpose              |
| ---------- | --------------- | -------------------- |
| any        | no              | Developer experience |

## Installation

```
npm i @wok-cli/plugin-notifier --save-dev
```

## Environmental variables

This plugin can be switched on/off by setting the boolean flag `enableNotify`:

```js
// wok.config.js
module.exports = {
  // ...
  enableNotify: false, // disable notifications
};
```

## Parameters

Configuration path: `notifier`.

| parameter | type   | default                                       | note                 |
| --------- | ------ | --------------------------------------------- | -------------------- |
| `title`   | string | package.json `title` field or `'application'` | Notification title   |
| `message` | string |                                               | Notification message |

## Usage

Notify the user when files are copied:

```js
const $ = require('@wok-cli/core');
const { copy } = require('@wok-cli/tasks');
const notifier = require('@wok-cli/plugin-imagemin');

const copyTask = $.task(copy, {
  src: 'static/**/*.*',
  dest: 'public/',
  'hooks:complete': {
    notifier: { message: 'Copy completed!' }
  },
});

copyTask.tap('complete', 'notifier', notifier);

export.copy = copyTask
```

Use the complete hook of a noop task to notify the user when a series of tasks have completed:

```js
const $ = require('@wok-cli/core');
const { clean, copy, noop } = require('@wok-cli/tasks');
const notifier = require('@wok-cli/plugin-notifier');

const cleanTask = $.task(clean, {
  pattern: 'public/',
});

const copyTask = $.task(copy, {
  src: 'static/**/*.*',
  dest: 'public/'
});

const notifyTask = $.task(noop, {
  notifier: { message: 'Build completed!' }
});

notifyTask.tap('complete', 'notifier', notifier);

export.copy = $.series(cleanTask, copyTask, notifyTask);
```

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