systemd-notify

1.0.0 • Public • Published

systemd-notify CircleCI

Notify systemd about start-up completion and other daemon status changes.

Installation

npm install systemd-notify

Usage

systemd-notify supports both callbacks and promises.

notify(opts = {}, [callback]);

const notify = require('systemd-notify');
 
const opts = {
    ready: true,
    status: 'Ready to go',
    pid: 1337
};
 
 
/**
 * Callback
 */
 
notify(opts, (err) => {
    /* Done */
});
 
 
/**
 * Promise
 */
 
notify(opts).then(() => {
    /* Done */
}).catch((err) => {
    /* Err */
});
 
 
/**
 * Async-await
 */
 
async function() {
    try {
        await notify(opts);
    }
    catch (e) {
        /* Err */
    }
}

For more information about the options, consult with the man-page: https://www.freedesktop.org/software/systemd/man/systemd-notify.html

License

MIT

/systemd-notify/

    Package Sidebar

    Install

    npm i systemd-notify

    Weekly Downloads

    229

    Version

    1.0.0

    License

    none

    Unpacked Size

    76.6 kB

    Total Files

    11

    Last publish

    Collaborators

    • nmorsman