Package Exports
- sd-notify
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sd-notify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sd-notify
Extremely minimal wrapper around
sd_notify
Installation
Firstly you need some systemd development files, on Ubuntu these can be installed via:
$ sudo apt install libsystemd-dev...then using npm or yarn:
$ npm install --save sd-notifyPlease note that this has currently only been tested on Ubuntu 16.04.
Usage
Example:
const notify = require('sd-notify')
// call notify after some async start up process
// such as in the `http` or `express` listen callback
app.listen(PORT, () => {
console.log('listening on port ' + PORT)
notify()
})Calling notify() will inform systemd that the process has started, when using notify type in a service definition file, eg:
[Unit]
Description=Simple notifying service
[Service]
Type=notify
ExecStart=/usr/sbin/simple-notifying-service
[Install]
WantedBy=multi-user.target