Skip to content

Commit 7feeed7

Browse files
authored
build: use node 10 or superior
1 parent 138eb22 commit 7feeed7

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

index.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
11
'use strict';
22

3-
function pify(fn, arg1, arg2) {
4-
return new Promise(function(resolve, reject) {
5-
fn(arg1, arg2, function(err, data) {
6-
if (err) return reject(err);
7-
resolve(data);
8-
});
9-
});
10-
}
11-
12-
// The method startsWith is not defined on string objects in node 0.10
13-
// eslint-disable-next-line no-extend-native
14-
String.prototype.startsWith = function(suffix) {
15-
return this.substring(0, suffix.length) === suffix;
16-
};
3+
const { promisify } = require('util');
174

18-
var pidtree = require('./lib/pidtree');
5+
const pidtree = require('./lib/pidtree');
196

207
/**
218
* Get the list of children pids of the given pid.
@@ -40,7 +27,7 @@ function list(pid, options, callback) {
4027
return;
4128
}
4229

43-
return pify(pidtree, pid, options);
30+
return promisify(pidtree)(pid, options);
4431
}
4532

4633
module.exports = list;

0 commit comments

Comments
 (0)