index.js 362 B

12345678910111213141516
  1. /**
  2. * @author oldj
  3. * @blog https://oldj.net
  4. */
  5. 'use strict'
  6. const path = require('path')
  7. require('fs').readdirSync(__dirname).map((file) => {
  8. /* If its the current file ignore it */
  9. if (file === 'index.js') return
  10. /* Store module with its name (from filename) */
  11. module.exports[path.basename(file, '.js')] = require(path.join(__dirname, file))
  12. })