As far as I know, there is no node.js extension that provides setrlimit() functionality, but you can get around the limitation with a workaround to bypass a small shell:
/bin/bash -c "ulimit -t 100; exec /usr/bin/node /my/node/program.js"
It looks like the node.js core will never be setrlimit() now that it supports Windows and is no longer the basis for POSIX only: https://github.com/joyent/node/pull/2143
Update: I converted the rejected Node patch to a separate posix extension module, which is now available on NPM and Github .
source share