# display-notification

> Display a notification (macOS)

Latest version **3.0.0** (published 2021-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install display-notification
pnpm add display-notification
yarn add display-notification
bun add display-notification
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-05-03 |
| First published | 2014-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 2 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 91 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | display, notification, notify, show, macos, mac, applescript, center, notifier |

## Links

- npm: https://www.npmjs.com/package/display-notification
- Repository: https://github.com/sindresorhus/display-notification
- Homepage: https://github.com/sindresorhus/display-notification#readme
- Issues: https://github.com/sindresorhus/display-notification/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/display-notification

## Dependencies (2)

- [run-applescript](https://npm.io/package/run-applescript.md) ^5.0.0
- [escape-string-applescript](https://npm.io/package/escape-string-applescript.md) ^3.0.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-05-03
- 2.0.0 — 2016-05-01
- 1.0.2 — 2015-02-16
- 1.0.1 — 2014-08-18
- 1.0.0 — 2014-08-06
- 0.1.0 — 2014-05-16

## README

# display-notification

> Display a notification *(macOS 10.9+)*

![](screenshot.png)

## Install

```
$ npm install display-notification
```

## Usage

```js
import displayNotification from 'display-notification';

await displayNotification({
	title: 'Unicorns',
	subtitle: 'Rainbows',
	text: 'Cake',
	sound: 'Bottle'
});
```

## API

### displayNotification(options)

Returns a promise that resolves when the notification is shown.

#### options

Specify at least a `title` or `text`.

##### title

Type: `string`

Title of the notification.

##### subtitle

Type: `string`

Subtitle of the notification.

##### text

Type: `string`

Content of the notification.

##### sound

Type: `string`\
Values: `Basso` `Blow` `Bottle` `Frog` `Funk` `Glass` `Hero` `Morse` `Ping` `Pop` `Purr` `Sosumi` `Submarine` `Tink`

Name of the sound located in `~/Library/Sounds` or `/System/Library/Sounds`:

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