post-notification-immediately

A helper Electron & Node.js module to post notifications immediately via macOS distributed notification center

Usage no npm install needed!

<script type="module">
  import postNotificationImmediately from 'https://cdn.skypack.dev/post-notification-immediately';
</script>

README

post-notification-immediately

A helper workaround module for Electron issue (#15789) to post notifications immediately via macOS distributed notification center. This module also can be used in any node.js application running on macOS.

Installation

$ npm install post-notification-immediately

Requires macOS 10.12 or later.

Usage

const postNotification = require('post-notification-immediately');

const userInfo = {
    data: 'Hey there! :)'
};

postNotification('kUniqueNotificationName',userInfo).then(
    () => {
        // sent successfully
    },
    (err) => {
        // error caused by payload parsing
    }
);

Maintainers

License

MIT