You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is obviously more of a suggestion than an issue.
One use of ps-list/tasklist is for daemons and services which need to check what processes are being run. When windows daemons spawn non-detached processes, windows will bring them to the foreground briefly, which obviously means that a daemon regularly using ps-list will have windows constantly popping up. This is probably an issue with either Windows, node child_process exec, or node daemonizers like forever and pm2, but it doesn't seem likely to be fixed.
The fix for this does not actually change the functionality for other users at all, so it shouldn't be a big deal.
I tested the following and worked for my application:
from index.js line 9
const windows = async () => {
const bin = path.join(__dirname, 'fastlist.exe');
const fullstdout = await new Promise((resolve, reject) => {
const childprocess = spawn(bin, {maxBuffer: TEN_MEGABYTES, detached: true});
var stdout = '';
var stderr = '';
childprocess.stdout.on('data', data => {
stdout += data.toString();
});
childprocess.stderr.on('data', data => {
stderr += data.toString();
});
childprocess.on('close', code => {
if(code != 0)
reject(new Error("FASTLIST THROUGH THE FOLLOWING ERRORS: ", stderr, "\nExit with code ", code));
else{
resolve(stdout);
}
});
});
return fullstdout
.trim()
.split('\r\n')
.map(line => line.split('\t'))
.map(([name, pid, ppid]) => ({
name,
pid: Number.parseInt(pid, 10),
ppid: Number.parseInt(ppid, 10)
}));
};
Obviously, nicer error messages could be added, but aside from that, this would fix this issue.
The text was updated successfully, but these errors were encountered:
This is obviously more of a suggestion than an issue.
One use of ps-list/tasklist is for daemons and services which need to check what processes are being run. When windows daemons spawn non-detached processes, windows will bring them to the foreground briefly, which obviously means that a daemon regularly using ps-list will have windows constantly popping up. This is probably an issue with either Windows, node child_process exec, or node daemonizers like forever and pm2, but it doesn't seem likely to be fixed.
The fix for this does not actually change the functionality for other users at all, so it shouldn't be a big deal.
I tested the following and worked for my application:
from index.js line 9
Obviously, nicer error messages could be added, but aside from that, this would fix this issue.
The text was updated successfully, but these errors were encountered: