Improved case switching for node/browsers

This commit is contained in:
Matt 2016-04-12 00:38:01 -04:00
parent 962fe68632
commit b9e75c983d
1 changed files with 10 additions and 10 deletions

View File

@ -361,20 +361,20 @@ mscript.tests = function tests () {
console.timeEnd('Tests took');
};
if (!module.parent) {
if (typeof process !== 'undefined') {
fs = require('fs');
input = process.argv[2];
mscript.init();
} else {
//web
}
} else {
console.log('module here');
if (typeof module !== 'undefined' && !module.parent) {
//node script
fs = require('fs');
input = process.argv[2];
mscript.init();
} else if (typeof module !== 'undefined' && module.parent) {
//module
fs = require('fs');
module.exports = mscript;
} else {
//web
}
/*
CAM # - go to camera frame #