Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/uki00a/deno-notifier.ts

Send desktop notifications with Deno
https://github.com/uki00a/deno-notifier.ts

desktop-notifications

Last synced: 22 days ago
JSON representation

Send desktop notifications with Deno

Awesome Lists containing this project

README

        

# deno-notifier.ts

[![Build Status](https://github.com/uki00a/deno-notifier.ts/workflows/ci/badge.svg)](https://github.com/uki00a/deno-notifier.ts/actions)
![https://img.shields.io/github/tag/uki00a/deno-notifier.ts.svg](https://img.shields.io/github/tag/uki00a/deno-notifier.ts.svg)
[![license](https://img.shields.io/github/license/uki00a/deno-notifier.ts)](https://github.com/uki00a/deno-notifier.ts)
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/notifier/mod.ts)

deno-notifier.ts is a Deno module for sending desktop notifications. It is
written in pure TypeScript.

> **This module is still highly experimental! In particular, it has not been
> fully tested on Windows and Mac OS.**

## Usage

```ts
import { notify } from "https://deno.land/x/notifier/mod.ts";

await notify("This is a title", "This is a message");

await notify({
title: "Hello",
message: "World",
sound: "device-added", // only supported in Linux and macOS
});
```

This module also provides API inspired by
[WHATWG's Notifications API](https://notifications.spec.whatwg.org/) (**WIP**).

```ts
import { Notification } from "https://deno.land/x/notifier/whatwg/mod.ts";

new Notification("Hello", {
body: "World",
icon: "/path/to/icon.png",
});
```

## Requirements

### Linux

You'll need to install one of the following:

- `notify-send`

### Mac OS X

You'll need to install one of the following:

- `osascript`

### Windows

You'll need to install one of the following:

- [Snoretoast](https://github.com/KDE/snoretoast)

## Prior works

- Node.js
- https://github.com/mikaelbr/node-notifier
- Go
- https://github.com/0xAX/notificator
- Ruby
- https://github.com/fnando/notifier