@jsjackson/cli-notify
v0.1.0
Published
Cross-platform Node adapter for native CLI notifications
Downloads
155
Readme
@jsjackson/cli-notify
This package selects an optional native runtime for the current platform:
@jsjackson/cli-notify-darwin-universal@jsjackson/cli-notify-linux-x64or@jsjackson/cli-notify-linux-arm64@jsjackson/cli-notify-win32-x64or@jsjackson/cli-notify-win32-arm64
Adopters do not need a global cli-notify installation.
Keep the caller-owned cli-notify.json and icon source in the adopting package,
then send through the manifest:
import { notifyFromManifest } from "@jsjackson/cli-notify";
notifyFromManifest(new URL("./cli-notify.json", import.meta.url), {
title: "Generation finished",
message: "The generated asset is ready.",
milestone: "finished",
override: "notify",
});On macOS, the first call installs the sender identity and later calls refresh it
only when its inputs change. Linux uses the freedesktop notification D-Bus
service. Windows uses WinRT toast notifications with the manifest bundle
identifier as its AppUserModelID. Headless Linux sessions are successful no-ops.
CLI_NOTIFY_BIN can override the selected executable for development and
testing.
