UNPKG

okra-framework

Version:
22 lines (15 loc) 377 B
'use strict'; const fs = require('fs'); const EXTENSION = /\..*/; okra.config = {}; const currentDir = process.cwd(); const configPath = currentDir + '/config/'; try { const files = fs.readdirSync(configPath); files.forEach(file => { file = file.replace(EXTENSION, ''); okra.config[file] = require(configPath + file); }); } catch (error) { throw error; }