MCPcopy
hub / github.com/webpack/webpack-dev-server / isInstalled

Function isInstalled

bin/webpack-dev-server.js:43–54  ·  view source on GitHub ↗
(packageName)

Source from the content-addressed store, hash-verified

41 * @returns {boolean} is the package installed?
42 */
43const isInstalled = (packageName) => {
44 if (process.versions.pnp) {
45 return true;
46 }
47
48 try {
49 require.resolve(packageName);
50 return true;
51 } catch {
52 return false;
53 }
54};
55
56/**
57 * @param {CliOption} cli options

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…