lib/index.js
function Diable(opts) {

    // The process is a daemon
    if (Diable.isDaemon()) {
        return false
    }

    opts = opts || {}

    const args = [].concat(process.argv)
    args.shift()

    const script = args.shift()
        , env = opts.env || process.env

    Diable.daemonize(script, args, opts)
    return process.exit()
}
function Diable(opts) {

    // The process is a daemon
    if (Diable.isDaemon()) {
        return false
    }

    opts = opts || {}

    const args = [].concat(process.argv)
    args.shift()

    const script = args.shift()
        , env = opts.env || process.env

    Diable.daemonize(script, args, opts)
    return process.exit()
}
function Diable ( opts ) { // The process is a daemon if ( Diable . isDaemon ( ) ) { return false } opts = opts || { } const args = [ ] . concat ( process . argv ) args . shift ( ) const script = args . shift ( ) , env = opts . env || process . env Diable . daemonize ( script , args , opts ) return process . exit ( ) }
Diable
Daemonizes processes the current process.

@name Diable
@function
@param {Object} opts An object which will be passed to the `exec` function. It is extended with:

- `env` (Object): The environment object (default: `process.env`).

@return {Number|Process} `false` if the process was already daemonized. Otherwise the process is closed anyways.
Diable Daemonizes processes the current process .