@wangdahoo/daemonize

1.0.0 • Public • Published

daemonize

daemonize a node.js application

Example

yarn add @wangdahoo/daemonize express morgan
const path = require('path')
const daemonize = require('@wangdahoo/daemonize')

const app = require('express')()
const port = process.env.PORT || 3000

app.use(require('morgan')('tiny'))

app.get('*', (req, res) => res.end('pong'))

app.listen(port, async () => {
    await daemonize({
        cwd: path.join(__dirname, '.')
    })
    console.info(`Listen on ${port}`)
})

That's all & have fun.

/@wangdahoo/daemonize/

    Package Sidebar

    Install

    npm i @wangdahoo/daemonize

    Weekly Downloads

    6

    Version

    1.0.0

    License

    none

    Unpacked Size

    403 kB

    Total Files

    111

    Last publish

    Collaborators

    • wangdahoo