All Projects → Pandawan → deno_notify

Pandawan / deno_notify

Licence: MIT License
Send desktop notifications on all platforms in Deno

Programming Languages

typescript
32286 projects
rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to deno notify

lostark-wait-notifier
🐤️ Lost Ark wait notifier
Stars: ✭ 38 (+40.74%)
Mutual labels:  notification
matterless
Self-hosted serverless
Stars: ✭ 23 (-14.81%)
Mutual labels:  deno
cron-schedule
A zero-dependency cron parser and scheduler for Node.js, Deno and the browser.
Stars: ✭ 28 (+3.7%)
Mutual labels:  deno
deno nightly
🌙 Nightly builds for Deno 🦕
Stars: ✭ 11 (-59.26%)
Mutual labels:  deno
twd
🚩 Simple tailwind like CLI tool for deno 🦕
Stars: ✭ 33 (+22.22%)
Mutual labels:  deno
react-notify
Tiny React's module that shows notifications.
Stars: ✭ 55 (+103.7%)
Mutual labels:  notification
Android-Firebase-Notification-With-PHP-Backend
This is a practice repository of Android Firebase Push Notification with PHP Backend. I wrote a blog post about this topic on my Bengali blog site.
Stars: ✭ 51 (+88.89%)
Mutual labels:  notification
doa
A middleware framework for Deno's http serve🦕. Transplanted from Koa with ❤️
Stars: ✭ 20 (-25.93%)
Mutual labels:  deno
BulkDownloader
BulkDownloader is used for multiple downloading process easy. It provides progress listener for each files and for whole file. It guarantees completion of download files as it runs on work manager
Stars: ✭ 24 (-11.11%)
Mutual labels:  notification
vue-notification-bell
Vue.js notification bell component.
Stars: ✭ 64 (+137.04%)
Mutual labels:  notification
deno-aws api
From-scratch Typescript client for accessing AWS APIs
Stars: ✭ 33 (+22.22%)
Mutual labels:  deno
lesvim
Nvim config focus on Javascript, Typescript, Rust and Lua - 🚀 💪 ( Fast and Powerfull ) - Deno and other typescript LSP working well together
Stars: ✭ 69 (+155.56%)
Mutual labels:  deno
notifyme
react-notification-timeline is a react based component helps in managing the notification in time-based manner.
Stars: ✭ 94 (+248.15%)
Mutual labels:  notification
birthday-keeper
一个生日管理APP, UI风格模仿的系统闹钟, 可以添加, 编辑, 删除生日以及本地推送提醒, 项目截图见README.
Stars: ✭ 27 (+0%)
Mutual labels:  notification
notify
📮 a micro-library to simplifies a simple communication between activity, fragment, services
Stars: ✭ 20 (-25.93%)
Mutual labels:  notification
denoflow
Configuration as Code, use YAML to write automated workflows that run on Deno, with any Deno modules, Typescript/Javascript codes
Stars: ✭ 143 (+429.63%)
Mutual labels:  deno
dino-bot
a bot that execute your deno code and send you the output! 🦕
Stars: ✭ 24 (-11.11%)
Mutual labels:  deno
tailspin
Site generator and design system in one
Stars: ✭ 19 (-29.63%)
Mutual labels:  deno
core
🌈 light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection
Stars: ✭ 40 (+48.15%)
Mutual labels:  deno
Multiplatform-Bus
Kotlin event-bus compatible with Android & native iOS
Stars: ✭ 43 (+59.26%)
Mutual labels:  notification

deno_notify

license build deno version deno doc

Send desktop notifications on all platforms in Deno.
Supports Windows, macOS, and linux using notify-rust though some features are platform-specific.

Note: More features are in the works and the API may change as a result.

Usage

The mod.ts entrypoint uses Plug internally so you don't have to download or open the plugin manually.

You will need to run using the --unstable and --allow-all permissions to allow for automatic plugin loading and caching.

import { Notification } from "https://deno.land/x/[email protected]/ts/mod.ts";

// Create a new notification
const notif = new Notification();

// Add a simple message
notif.title("My message");

// Display it
notif.show();

Or stack together your desired options:

new Notification({ macos: true })
  .title("My message")
  .body("Hello, World!")
  .soundName("Basso")
  .show();

Documentation

Check out the Documentation for a list of available features.

Platform-Specific Features

By default, only cross-platform features are available. In order to enable platform-specific features (e.g. icons), you can pass in booleans flags to specify the supported platforms in the Notification's constructor.

// Enable linux-specific-features
const notif = new Notification({ linux: true });

// Notification.icon() is now available
notif.icon("/path/to/icon");

Specifying platforms may also provide different documentation and typings for the Notification API.

For example, macOS has specific sound names that are available for Notifications; these are reflected in the macOS-specific Notification API.

IntelliSense Suggesting MacOS Sound Names When Calling Notification.soundName()

Strict Platform Checking

The second parameter of the Notification's constructor can be used to determine whether the platform-features should be checked at runtime. When true (default), any platform-specific feature will error if used on a platform that does not support it. When false, the error will be silently ignored.

Note: Platform checking is performed both at compile time (TypeScript) and at runtime.

// Icons are not supported on macOS
// If notif.icon() is called on a macOS computer, this will error.
const notif = new Notification({ linux: true }, true);
notif.icon("/path/to/icon");

// This will not error; however, no icon will be displayed on macOS.
const notif = new Notification({ linux: true }, false);
notif.icon("/path/to/icon");

FAQ

Installing Manually

By default, the ffi library will automatically be downloaded via Plug to match your deno_notify version.

However, in some cases you may want to refer to a local version of the library files. To do so, you can set the environment variable NOTIFY_PLUGIN_URL to the path of the library file(s).

You can set the environment variable via command line, or directly through Deno via Deno.env.set(). (Note that you must import deno_notify after having set the environment variable for this option to take effect).

Known Issues

  • Many platform-specific features are not implemented
    • Features like actions, subtitle, hints, etc.
    • Need to integrate new mac-notification-sys changes into notify-rust
  • Icons/app_id on macOS are not implemented because of following issues:
    • Custom app icons are only applied if the notification requesting it is the first one being sent on mac
      • This means an app icon cannot be changed once set, and cannot be changed even if it wasn't set in the first one.
    • Using a custom app icon on mac sometimes crashes

Contributing

Pull request, issues and feedback are very welcome. Code style is formatted using deno fmt -c deno.jsonc. When adding new features, please also add tests in the tests directory.

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].