indexzero / ps-tree

MIT License
149 stars 29 forks source link

Still maintained? (Update Dependencies?) #10

Closed nelsonic closed 9 years ago

nelsonic commented 9 years ago

Hi @indexzero is this module still maintained? Do you have plans to update it? e.g. dependencies: Dependency Status

Would you accept a PR with tests?

indexzero commented 9 years ago

@nelsonic a PR would be welcome, but I'm not actively maintaining it. Would you like to be the new head maintainer? :smile:

nelsonic commented 9 years ago

@indexzero I've added some basic tests on a branch: https://github.com/nelsonic/ps-tree/issues/1 But unable to get past 92% coverage because of the if(!module.parent) which allows the script to be called directly:

if(!module.parent) {
  childrenOfPid(process.argv[2] || 1, function (err, data) {
  console.log(data)
  })

I tried to execute the file from inside my test:

  var child = cp.exec("node ./index.js", function(error, data) {
    console.log('data: ' + data.length);
    if (error !== null) {
        console.log(red('exec error: ' + error));
    }
  })

But that still does not improve coverage...

If you can live without 100% test coverage I can submit the PR.

indexzero commented 9 years ago

I would be happy to remove the !module.parent part all together and make that a separate bin/ps-tree script.

nelsonic commented 9 years ago

Ok. I can do that. Next steps:

  1. I will add a bin/ps-tree script to invoke the module from command line
  2. Update the dependency on event-stream
  3. Re-run tests Will keep you posted. :+1:
nelsonic commented 9 years ago

@indexzero I have substituted:

if(!module.parent) {
  childrenOfPid(process.argv[2] || 1, function (err, data) {
  console.log(data)
  })
}

for ./bin/ps-tree.js containing:

#!/usr/bin/env node
'use strict';
require('../')(process.argv[2] || 1, function (err, data) {
  console.log(data)
});

As a result we get 100% test coverage. :+1:

nelsonic commented 9 years ago

Build passes: https://travis-ci.org/nelsonic/ps-tree/builds/56141651 Submitting PR.

nelsonic commented 9 years ago

@indexzero should I do a major _version bump_ in package.json or leave that to you?