Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [current, 16, 14, 12, 10, 8, 6, 4]
node: [14, 16, 18]
steps:
- name: Setup repo
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [current, 16, 14, 12, 10, 8, 6, 4]
node: [14, 16, 18]
steps:
- name: Setup repo
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [current, 16, 14, 12, 10, 8, 6, 4]
node: [14, 16, 18]
steps:
- name: Setup repo
uses: actions/checkout@v3
Expand Down
23 changes: 3 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
'use strict';

function pify(fn, arg1, arg2) {
return new Promise(function(resolve, reject) {
fn(arg1, arg2, function(err, data) {
if (err) return reject(err);
resolve(data);
});
});
}

// Node versions prior to 4.0.0 do not define have `startsWith`.
/* istanbul ignore if */
if (!String.prototype.startsWith) {
// eslint-disable-next-line no-extend-native
String.prototype.startsWith = function(suffix) {
return this.substring(0, suffix.length) === suffix;
};
}

var pidtree = require('./lib/pidtree');
const util = require('node:util');
const pidtree = require('./lib/pidtree');

/**
* Get the list of children pids of the given pid.
Expand All @@ -43,7 +26,7 @@ function list(pid, options, callback) {
return;
}

return pify(pidtree, pid, options);
return util.promisify(pidtree)(pid, options);
}

module.exports = list;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"index.d.ts"
],
"engines": {
"node": ">=0.10"
"node": ">= 14"
},
"scripts": {
"start": "node ./bin/pidtree.js",
Expand Down