-
extras: A pair of functions that return text to insert before or after the
module's source code. Each function accepts two parameters: targetPath, the
path to the required module, and parentModule, the Module object for the
module's parent. Each function must return a string.
extras.before: A function that returns text to insert before the
module's source code.
extras.after: A function that returns text to insert after the module's
source code.
-
infect: Determines whether child modules are infected with the same changes
as the parent module. Set to true to force child modules to inherit your
changes. Defaults to false.
-
requirePaths: Additional paths to search for required modules. For example,
if requirePaths is set to ['/usr/lib/junk/modules'], and you save a
JavaScript module at /usr/lib/junk/modules/mymodule.js, you can require the
module as mymodule.
You can provide an array of paths, which will be searched before the default
module paths, or an object with the following properties:
requirePaths.before: An array of paths to search before the default
module paths.
requirePaths.after: An array of paths to search after the default module
paths. Use this property if you want the module to use its own local
dependencies when possible, then fall back to the additional paths if
necessary.
By default, the require path is not changed.