src: add -r/--require flags for preloading modules
authorAli Ijaz Sheikh <ofrobots@google.com>
Tue, 17 Feb 2015 22:37:37 +0000 (14:37 -0800)
committerChris Dickinson <christopher.s.dickinson@gmail.com>
Fri, 13 Mar 2015 20:54:34 +0000 (13:54 -0700)
commit7bde3f1a8f53d82992a8fed73e5f93159bb400b3
tree63d4951ae996ac83ff0f0292f7ce241bdb3c935d
parent53e200acc2b58fc3b33505b61a2f60d542e85f20
src: add -r/--require flags for preloading modules

-r/--require can be used to preload modules on node startup. The option
takes a single module name. The option can be repeated as necessary to
preload multiple modules.

This patch allows 'vendors' (such a cloud host) to inject functionality
that gets executed at application startup without requiring an explicit
require from the user's application. This can be useful to load vendor
specific application monitoring APIs transparently.

PR-URL: https://github.com/iojs/io.js/pull/881
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
doc/iojs.1
src/node.cc
src/node.js
test/fixtures/printA.js [new file with mode: 0644]
test/fixtures/printB.js [new file with mode: 0644]
test/fixtures/printC.js [new file with mode: 0644]
test/parallel/test-preload.js [new file with mode: 0644]