Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

daemon-fix41

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

daemon-fix41

Add-on for creating *nix daemons

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
364
increased by16.29%
Maintainers
1
Weekly downloads
 
Created
Source

FORK

This fork fixes indexzero/daemon.node#41 issue. I published it to npm under daemon-fix41 package because I need use it in frontail.

npm i daemon-fix41

Original README below.


daemon

Build Status

Turn a node script into a daemon.

install via npm

npm install daemon

Requires node >= 0.8

examples

// this code is run twice
// see implementation notes below
console.log(process.pid);

// after this point, we are a daemon
require('daemon')();

// different pid because we are now forked
// original parent has exited
console.log(process.pid);

api

daemon(opt)

Respawn the process (self) as a daemon. The parent process will exit at the point of this call. opt parameter see below.

daemon.daemon(script, args, opt)

Spawn the script with given args array as a daemonized process. Return the child process object.

opt can optionally contain the following arguments:

  • stdout (file descriptor for stdout of the daemon)
  • stderr (file descriptor for stderr of the daemon)
  • env (environment for the daemon) (default: process.env)
  • cwd (current working directory for daemonized script) (default: process.cwd)

implementation notes

Daemon actually re-spawns the current application and runs it again. The only difference between the original and the fork is that the original will not execute past the daemon() call whereas the fork will.

node versions prior to 0.8

Using this module on older versions of node (or older versions of this module) are not recommended due to how node works internally and the issues it can cause for daemons.

Contributors

Charlie Robbins
Pedro Teixeira
James Halliday
Zak Taylor
Daniel Bartlett
Charlie McConnell
Slashed
Roman Shtylman

FAQs

Package last updated on 07 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc