How to use the resolve 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 alexanderGugel / ied / test / e2e / install.e2e.js View on Github external
it(`should make ${name} require\'able`, (done) => {
				resolve(name, {basedir: cwd}, (err, res) => {
					assert.ifError(err)
					assert.notEqual(res.indexOf(cwd), -1)
					require(res)
					done()
				})
			})
		})
github alexanderGugel / ied / test / e2e / install.e2e.js View on Github external
it(`should make ${target} require\'able`, (done) => {
				resolve(target, {basedir: cwd}, (err, res) => {
					assert.ifError(err)
					assert.notEqual(res.indexOf(cwd), -1)
					require(res)
					done()
				})
			})
		})
github rollup / plugins / packages / node-resolve / src / index.js View on Github external
new Promise((fulfil, reject) =>
    resolveId(file, opts, (err, contents) => (err ? reject(err) : fulfil(contents)))
  );
github flow-typed / flow-typed / cli / src / lib / createStub.js View on Github external
return new Promise((resolve, reject) =>
    resolveAsync(name, options, (err, result) => {
      if (err) {
        reject(err);
      } else {
        resolve(result);
      }
    })
  );
github rollup / rollup-plugin-node-resolve / src / index.js View on Github external
const resolveIdAsync = (file, opts) => new Promise((fulfil, reject) => resolveId(file, opts, (err, contents) => err ? reject(err) : fulfil(contents)));
github AtomLinter / linter-stylelint / lib / helpers.js View on Github external
return new Promise((resolve, reject) => {
    requireResolve(request, options, (err, result) => {
      if (err) {
        reject(err);
      } else {
        resolve(result);
      }
    });
  });
}
github esy / esy / esy-install / src / util.js View on Github external
return new Promise((resolve, reject) => {
    resolveBase(packageName, {basedir: baseDirectory}, (err, resolution) => {
      if (err) {
        reject(err);
      } else {
        resolve(resolution);
      }
    });
  });
}
github open-wc / open-wc / packages / es-dev-server / src / utils / resolve-module-imports.js View on Github external
return new Promise((resolve, reject) =>
    nodeResolveWithCallback(importPath, options, (error, result) => {
      if (error) {
        reject(error);
      } else {
        resolve(result);
      }
    }),
  );

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