![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Monitor parallel jobs
npm install --save-dev alarmist
Execute a job
alarmist-job -n name my-command [args...]
Monitor jobs
alarmist-monitor my-watch-command [args...]
Jobs will appear on first run and can be expanded (one at a time) to display logs
NB. By default many commands will not produce colored output when run like this, however many commands also have options to force colors. Eg. many node CLI tools use the chalk
library and so will have a --color
option or support the FORCE_COLOR=true
environment variable
All the logs and status files will also be captured in the .alarmist
working directory with the following structure
.
└── .alarmist/
├── blessed.log - internal UI logging for debug purposes
├── process.log - the monitor command's log
├── control.sock - unix socket or windows named pipe information that jobs use to notify the monitor on status change
├── log.sock - unix socket or windows named pipe information that jobs use to pipe logs to the monitor
└── jobs/
└── [name]
├── last-run - the last run number
└── [run number]/
├── process.log - the job run's log
└── status.json - the job run's status
NB. The .alarmist
working directory will be reset every time the monitor is started
var alarmist = require('alarmist');
Create a job.
alarmist.createJob('name')]
.then(function(job) {
...
});
The job will expose a log
write stream that you can use for logging.
job.log.write('this gets logged');
When the job is complete call the exit
method to signal success or failure with an exit code.
job.exit(0)
.then(function() {
...
});
alarmist.execJob({
name: 'name',
command: 'my-command',
args: []
}).then(function() {
...
});
Start a monitor and watcher process
alarmist.execMonitor({
command: 'my-watcher-command',
args: []
})
.then(function(monitor) {
...
});
Listen for start events when jobs start
monitor.on('start', function(job) {
console.log(job.id);
console.log(job.name);
console.log(job.startTime);
});
Listen for log events when jobs log data
monitor.on('log', function(job) {
console.log(job.id);
console.log(job.name);
console.log(job.data); // this should be a Buffer
});
Listen for end events when jobs end
monitor.on('end', function(job) {
console.log(job.id);
console.log(job.name);
console.log(job.startTime);
console.log(job.endTime);
console.log(job.exitCode);
});
Read from the monitor log stream, for logging from the watcher command
monitor.log.on('data', function(data) {
console.log(data) // this shoud be a Buffer
});
Listen for an exit
event that signifies an error as the watcher process should not exit
monitor.on('exit', function(code) {
console.log(code);
});
Stop a monitor
monitor.close();
Start a monitor
alarmist.createMonitor()
.then(function(monitor) {
// create and manage your watcher
...
});
Listen for job events as above
Log for your watcher process
monitor.log.write('output');
Signal the exit of the watcher process (watcher processes aren't meant to exit so this is really signalling an error)
// provide an exit code
monitor.exit(1);
Listen for exit events and close the monitor as above
Run tests, etc before pushing changes/opening a PR
npm test
- lint and testnpm run build
- run tests then buildnpm run watch
- watch for changes and run buildnpm run ci
- run build and submit coverage to coverallsnpm start
- use alarmist to monitor its own build tasks in parallel :)FAQs
Monitor parallel jobs
The npm package alarmist receives a total of 7 weekly downloads. As such, alarmist popularity was classified as not popular.
We found that alarmist 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.