lib/requizzle.js
function isNativeModule(targetPath, parentModule) {
    const lookupPaths = Module._resolveLookupPaths(targetPath, parentModule, true);

    /* istanbul ignore next */
    return lookupPaths === null ||
        (lookupPaths.length === 2 &&
        lookupPaths[1].length === 0 &&
        lookupPaths[0] === targetPath);
}
function isNativeModule(targetPath, parentModule) {
    const lookupPaths = Module._resolveLookupPaths(targetPath, parentModule, true);

    /* istanbul ignore next */
    return lookupPaths === null ||
        (lookupPaths.length === 2 &&
        lookupPaths[1].length === 0 &&
        lookupPaths[0] === targetPath);
}
function isNativeModule ( targetPath , parentModule ) { const lookupPaths = Module . _resolveLookupPaths ( targetPath , parentModule , true ) ; /* istanbul ignore next */ return lookupPaths === null || ( lookupPaths . length === 2 && lookupPaths [ 1 ] . length === 0 && lookupPaths [ 0 ] === targetPath ) ; }
Function that returns text to swizzle into the module.

@typedef module:lib/requizzle~wrapperFunction
@type {function}
@param {string} targetPath - The path to the target module.
@param {string} parentModulePath - The path to the module that is requiring the target module.
@return {string} The text to insert before or after the module's source code.
 
Options for the wrappers that will be swizzled into the target module.

@typedef module:lib/requizzle~options
@type {Object}
@property {Object=} options.extras - Functions that generate text to swizzle into the target
module.
@property {module:lib/requizzle~wrapperFunction} options.extras.after - Function that returns
text to insert after the module's source code.
@property {module:lib/requizzle~wrapperFunction} options.extras.before - Function that returns
text to insert before the module's source code.
@property {(Array.<string>|string)} options.requirePaths - Additional paths to search when
resolving module paths in the target module.
Function that returns text to swizzle into the module .