How to use the resolve/lib/sync function in resolve

To help you get started, we’ve selected a few resolve examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mihe / tsu / Source / TsuBootstrap / source / require.ts View on Github external
function resolve(id: string) {
	return trimRoot(
		__resolve(id, {
			basedir: __dirname,
			readFileSync: (path: string) => __file.read(trimRoot(path)),
			isFile: (path: string) => __file.exists(trimRoot(path))
		})
	);
}

resolve

resolve like require.resolve() on behalf of files asynchronously and synchronously

MIT
Latest version published 3 days ago

Package Health Score

80 / 100
Full package analysis