9 lines
178 B
JavaScript
9 lines
178 B
JavaScript
function packageExists(packageName) {
|
|
try {
|
|
return require.resolve(packageName);
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
module.exports = packageExists;
|