From 9faccf86387255e5fd1ee81b4f097b0302edc45c Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Mon, 30 Jan 2012 23:37:14 +0400 Subject: [PATCH] Added utils module --- lib/utils.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/utils.js diff --git a/lib/utils.js b/lib/utils.js new file mode 100644 index 00000000..ba4729ee --- /dev/null +++ b/lib/utils.js @@ -0,0 +1,11 @@ +exports.safeRequire = safeRequire; + +function safeRequire(module) { + try { + return require(module); + } catch (e) { + console.log('Run "npm install ' + module + '" command to use jugglingdb using this database'); + return false + } +} +