mirror of
https://github.com/hanzoai/mongodb-memory-server.git
synced 2026-09-24 17:00:24 +00:00
20 lines
454 B
JavaScript
20 lines
454 B
JavaScript
/* eslint @typescript-eslint/no-var-requires: 0 */
|
|
|
|
function doesModuleExist(name) {
|
|
try {
|
|
return !!require.resolve(name);
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
const modulePath = 'mongodb-memory-server-core/lib/util/postinstallHelper';
|
|
|
|
if (!doesModuleExist(modulePath)) {
|
|
console.log('Could not find file "postinstall" in core package!');
|
|
|
|
return;
|
|
}
|
|
|
|
require(modulePath).postInstallEnsureBinary(require('./package.json').mongodb_version);
|