uki00a / deno-notifier.ts

Send desktop notifications with Deno

Home Page:https://deno.land/x/notifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deno-notifier.ts

Build Status https://img.shields.io/github/tag/uki00a/deno-notifier.ts.svg license deno doc

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

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 (WIP).

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:

Prior works

About

Send desktop notifications with Deno

https://deno.land/x/notifier

License:MIT License


Languages

Language:TypeScript 100.0%