Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

- add child_process.fork

- add os.getNetworkInterfaces()

- add remoteAddress and remotePort for client TCP connections

I've been waiting for them to push these features out. (yes, I know you already have the address & port if you are a client).



I got too excited about child_process.fork before I read the description. I was imagining it would be like C where I can fork, setup the env and exec. That would probably be tricky and very ugly to implement, though..


I have a binding for *nix fork() here:

https://github.com/felixge/node-nix

However, you need to know what you are doing, otherwise you'll have multiple processes draining the same file descriptors which will give you some nice surprises : )


Wow, awesome. It shouldn't be hard to create a binding for execvp as well then. I found the pipe() binding, but I can't use those fd's with child_process.spawn if i want to open them as fd 3, 4, 5, etc in the child.


I don't think it would be too many lines of code, tbh http://nodejs.org/docs/v0.5.0/api/all.html#child_process.exe...


child_process.exec is different from n*x system exec. Node is still doing the fork()ing and exec()ing behind the scenes. Exposing those calls in node would give you direct access to the child process before executing your commands.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: