function createRequire( module ) {
	/**
	* Attempts to load a module.
	*
	* @private
	* @param {string} path - module id
	* @returns {*} module
	*/
	function require( path ) {
		return module.require( path );
	}

	/**
	* Attempts to resolve a module.
	*
	* @private
	* @param {string} name - module
	* @param {Object} [options] - options
	* @throws {TypeError} first argument must be a string
	* @returns {string} module filepath
	*/
	function resolve( name, options ) {
		if ( !isString( name ) ) {
			throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', name ) );
		}
		return resolveFilename( name, module, false, options );
	}

	/**
	* Attempts to resolve look-up paths.
	*
	* @private
	* @param {string} name - module
	* @throws {TypeError} must provide a string
	* @returns {(StringArray|null)} resolved paths
	*/
	function paths( name ) {
		if ( !isString( name ) ) {
			throw new TypeError( format( 'invalid argument. Must provide a string. Value: `%s`.', name ) );
		}
		return resolveLookupPaths( name, module, true );
	}

	// Script entry point when Node.js process launched:
	require.main = main;

	// Attach method to resolve a module:
	resolve.paths = paths;
	require.resolve = resolve;

	// Support for extra extension types:
	require.extensions = extensions;

	// Use the existing module cache:
	require.cache = cache;

	return require;
}
Returns a `require` function.

@private
@param {Module} module - module used as the context for `require`
@returns {Function} require function