
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
用于在后台运行程序中启动一个进程执行相应的脚本
npm install pfork --save
var p = require('pfork');
var options = {
script: '/User/xxx/test/script.js', //必填
value: '/User/xxx/test/server.js', //可选
//其它字段
};
//会根据script和value自动去重
p.fork(options, function(err, data, child) {
//启动结束
//child.on('data', function(data) {});
//child.sendData(data);
//child.on('exit', function() {}); //退出的时候
});
/User/xxx/test/script.js
//options与fork的options字段一致
module.exports = function(options, callback) {
//do sth
// process.sendData(data);
callback(err, data);
};
kill process:
p.kill({
script: '/User/xxx/test/script.js',
value: '/User/xxx/test/server.js'
});
判断进程是否已存在:
p.exists({
script: '/User/xxx/test/script.js',
value: '/User/xxx/test/server.js'
});
FAQs
fork process
The npm package pfork receives a total of 1,020 weekly downloads. As such, pfork popularity was classified as popular.
We found that pfork demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.