env.js 452 B

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