Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
background-service-runner
Advanced tools
Readme
A daemon runner utility for node, python, shell and other executable services. Can be configured to run a monitored or detached child process or groups of processes.
Background Service Runner provides support for running executables in the background as detached, independent processes or as fully monitored child processes. The typical use case is to create a short script to run a longer running service like an HTTP web service. It can also be used to start and stop groups of services with a single script.
npm install background-service-runner --save
The following demonstrates a minimal run script that runs a job as a detached script.
var runner = require('background-service-runner').createDaemonRunner(),
command = __dirname + '/Job.js',
child = runner.start( command );
console.log('pid: ', child.pid);
By default the runner detaches from the child so that it may exit after spawning the child. If you want the runner to exit immediately after spawning the job, then invoke start/stop like this:
var child = runner.start();
console.log( 'child running on pid: ', child.pid );
runner.stop();
There is a test runner and executable in the examples directory. Invoke the test runner and observe the log file examples/job.log to see its entries.
Unit tests written in mocha/chai/should and run using grunt. All code tested with jshint.
make test
- or -
make watch
The project exposes two mocks for testing.
See the existing tests for use, but generally you can use these mocks like this...
var MockSpawn = require('background-service-runner').mocks.MockSpawn;
...
var mock = new MockSpawn(),
opts = {
log:log,
spawn:mock.spawn
},
runner = new DaemonRunner( opts );
var child = runner.start( 'mycommand', [ 'foo', 'bar' ] );
should.exist( child );
child.pid.should.be.above( 1000 );
Note: works in linux/unix but not tested in windows.
Copyright © 2014-2016, rain city software | Version 0.91.10
FAQs
A daemon runner utility for node, python, shell and other executable services. Can be configured to run a monitored or detached child process or groups of processes.
The npm package background-service-runner receives a total of 46 weekly downloads. As such, background-service-runner popularity was classified as not popular.
We found that background-service-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.