env.js 459 B

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