How to use the deferred.promisifySync function in deferred

To help you get started, we’ve selected a few deferred 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 medikoo / modules-webmake / lib / parser.js View on Github external
resolveExternal(fromfile, fileDirname, scope, dep) {
		log.debug("resolve external %s", dep.value);
		const org = dep.value, lScope = scope;
		let filename = join(dep.value), tree, currentRequire, main, path, ext;

		const [name] = filename.split(sep, 1);
		return deferred.promisifySync(() => {
			// If already processed, return result
			if (this.modules[name]) return this.modules[name];

			if (name === "webmake") {
				this.packages.webmake = resolve(__dirname, "../");
				return (this.modules.webmake = {});
			}
			// Find path to package with Node.js internal functions
			currentRequire = getRequire(fromfile);
			try {
				path = main = currentRequire.resolve(name);
			} catch (e) {
				// No main module for the package, try full require path
				try {
					path = currentRequire.resolve(org);
				} catch (e2) {

deferred

Modular and fast Promises implementation

ISC
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis