Require Modules from the Command Line
io.js v1.6.0 introduces a new command line option: -r
or --require
, which can be used to pre-load modules at startup, see:
https://github.com/iojs/io.js/blob/v1.x/CHANGELOG.md#2015-03-19-version-160-chrisdickinson
I can think of one interesting use case: overriding the default behavior or console.log
to perform deep inspection:
|
|
Now I can pre-load this script to have all console log show in better format:
|
|
Time to find out more use cases.