systemdify
Automatically create a systemd unit file for your Node application based on package.json
Install
npm install --save systemdify
or to use the CLI
npm install -g systemdify
Node API
var systemdify = var file =
Will return the following:
[Unit]
Description=My Awesome Application
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/node /path/to/my/app/server.js
Restart=always
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
CLI
Usage
$ systemdify <folder>
Options
-o, --output Write output to file
Examples
$ systemdify /path/to/my/app -o my-app.service
$ cat my-app.service
[Unit]
description=My Application
...
NPM Hooks
The recommended way to use to module is to add it to your dev dependencies and execute the package after you've done an NPM install.
...scripts: ...