Gathering detailed insights and metrics for init
Gathering detailed insights and metrics for init
Gathering detailed insights and metrics for init
Gathering detailed insights and metrics for init
init-package-json
A node module to get your node module started
postcss-reduce-initial
Reduce initial definitions to the actual initial value, where possible.
@lerna/init
Create a new Lerna repo or upgrade an existing repo to the current version of Lerna
ava-init
Add AVA to your project
npm install init
Typescript
Module System
Min. Node Version
Node Version
NPM Version
CoffeeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
30 Stars
13 Commits
16 Forks
6 Watchers
1 Branches
2 Contributors
Updated on Nov 19, 2024
Latest Version
0.1.2
Package Id
init@0.1.2
Size
3.93 kB
NPM Version
1.0.3
Node Version
v0.4.8
Published on
Oct 04, 2011
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Turn your node daemon into an LSB-compatible init script.
init = require('init');
init.simple({
pidfile : '/var/run/myprog.pid',
logfile : '/var/log/myprog.log',
command : process.argv[3],
run : function () {
doWhateverMyDaemonDoes();
}
})
You're in luck (maybe). simple() just makes the easy case easy. See the api methods below for more flexible ways to use this module.
Starts your service. This function will not return, and takes the following keyword arguments:
Required. This should be a path to a file to lock and store the daemon pid in. If the daemon is already running according to this pidfile, start succeeds without doing anything.
Path to a file to redirect your daemon's stdout and stderr to. Defaults to /dev/null.
Required. A function to be called after daemon setup is complete. Do your daemon work here.
A function to be called when the start action succeeded (already running or about to daemonize). 'pid' will be the id of the running process, and 'wasRunning' is true if the process was already running.
A function to be called if the start action cannot be performed. Error will be some sort of stringifiable error object. Defaults to init.startFailed.
Stops your service with one of shutdown functions. Default is
init.hardKiller(2000)
, but you may pass your own.
Gets the status of your service. The status is not returned, but rather will be passed to cb if you provide it (defaults to init.printStatus). It is an object of the form: { running: true, pid: 3472, exists: true }.
Higher level method that leaves all the callbacks as defaults and dispatches to calling the right function depending on the string you provide. Takes the following keyword arguments:
As in init.start()
As in init.stop()
A string on which to dispatch. Defaults to your program's first argument (process.argv[2]). Recognized actions are "start", "stop", "restart", "try-restart", "force-reload", and "status".
As in init.stop()
Sends your service TERM, INT, QUIT, in that order (with 2000 ms delays) and then KILL until the process is no longer running, then calls cb (defaults to init.stopped). If the process was running, cb's first argument will be true. This is the default shutdown function.
Sends your service TERM and waits until it dies with 2000 ms delays. If it is more important that your service shutdown gracefully (to preserve data integrity, etc) than that it exits promptly, this is a good choice.
These functions are the defaults for various callbacks, but you can call them from your own custom callbacks if you want to augment them instead of replacing them.
Prints "Started with PID n" or "Already running with PID n" and exits with a 0 status code.
Prints error and exits with a 1 status code.
Prints "Stopped" or "Not running" and exits with a 0 status code.
Prints a human-readable message and exits with an LSB-appropriate error code.
Program is running:
Process is already running with pid N.
exit 0
Program is dead (exited without removing pid file)
Pidfile exists, but process is dead.
exit 2
Program is not running:
Not running.
exit 3
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/8 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More