env.js 443 B

123456789101112131415161718192021
  1. var env = require('../').env;
  2. console.log('environment: %s', env.type);
  3. var col;
  4. switch (env.type) {
  5. case 'node':
  6. col = require('./collection/node');
  7. break;
  8. case 'mongo':
  9. col = require('./collection/mongo');
  10. break;
  11. case 'browser':
  12. col = require('./collection/browser');
  13. break;
  14. default:
  15. throw new Error('missing collection implementation for environment: ' + env.type);
  16. }
  17. module.exports = exports = col;