12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- '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);
- });
- });
- }
- if (!String.prototype.startsWith) {
-
- String.prototype.startsWith = function(suffix) {
- return this.substring(0, suffix.length) === suffix;
- };
- }
- var pidtree = require('./lib/pidtree');
- function list(pid, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = undefined;
- }
- if (typeof callback === 'function') {
- pidtree(pid, options, callback);
- return;
- }
- return pify(pidtree, pid, options);
- }
- module.exports = list;
|