UNPKG

keystone

Version:

Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose

14 lines (12 loc) 277 B
module.exports = function safeRequire (library, feature) { try { return require(library); } catch (error) { if (error.code === 'MODULE_NOT_FOUND') { console.error('\nTo use ' + feature + ' install ' + library); process.exit(1); return; } throw error; } };