Added utils module

This commit is contained in:
Anatoliy Chakkaev 2012-01-30 23:37:14 +04:00
parent 643c2879fe
commit 9faccf8638
1 changed files with 11 additions and 0 deletions

11
lib/utils.js Normal file
View File

@ -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
}
}