NUEVA BUSQUEDA DE DATOS SRI

This commit is contained in:
2023-04-11 10:50:28 -05:00
parent d9d7eb83cb
commit 6b4b3e263c
612 changed files with 11604 additions and 36692 deletions

19
node_modules/pstree.remy/lib/tree.js generated vendored
View File

@@ -1,12 +1,12 @@
const spawn = require('child_process').spawn;
module.exports = function(rootPid, callback) {
const tree = {};
module.exports = function (rootPid, callback) {
const pidsOfInterest = new Set([parseInt(rootPid, 10)]);
var output = '';
// *nix
const ps = spawn('ps', ['-A', '-o', 'ppid,pid']);
ps.stdout.on('data', data => {
ps.stdout.on('data', (data) => {
output += data.toString('ascii');
});
@@ -15,12 +15,15 @@ module.exports = function(rootPid, callback) {
const res = output
.split('\n')
.slice(1)
.map(_ => _.trim())
.map((_) => _.trim())
.reduce((acc, line) => {
if (line.indexOf(rootPid + ' ') === 0) {
const pid = line.split(/\s+/).pop();
acc.push(parseInt(pid, 10));
rootPid = pid;
const pids = line.split(/\s+/);
const ppid = parseInt(pids[0], 10);
if (pidsOfInterest.has(ppid)) {
const pid = parseInt(pids[1], 10);
acc.push(pid);
pidsOfInterest.add(pid);
}
return acc;