pkrumins / node-tree-kill

kill trees of processes
MIT License
333 stars 37 forks source link

TypeScript definitions #19

Closed borekb closed 6 years ago

borekb commented 6 years ago

Provides a bit nicer developer experience:

image

billiegoose commented 6 years ago

I like it! Quick question though. Technically the code still works if signal is a number (because process.kill allows signal to be a number) and if pid is a string (because we manually convert pid to an integer because of this bug in an old version of Node). Should we include those possibilities in the typescript definition or leave them as-is to encourage people to use the expected type?

borekb commented 6 years ago

You're right about the string / number for signal, I've updated the type definitions in https://github.com/pkrumins/node-tree-kill/pull/19/commits/13752aba4810c0ff567d3c8ee7c4e8dd5e9a1fc5 and done some other smaller improvements. pid always seems to be a number, at least in reasonably recent versions of Node, so I kept it as number only (feel free to update it if you think it's incorrect).

I've also added test/types.ts as a playground, works nicely in VSCode (and in Atom I would assume).

billiegoose commented 6 years ago

Very nice! Published in v1.2.0