UNPKG

435 BJavaScriptView Raw
1'use strict';
2
3const glob = require('glob');
4const path = require('path');
5
6const FEATURES_PATH = path.resolve(__dirname, './features');
7const FEATURES = {};
8
9glob
10 .sync('*.js', { cwd: FEATURES_PATH })
11 .sort()
12 .forEach((filename) => {
13 let key = filename.slice(0, -3);
14 let value = Object.assign({}, require(`./features/${key}`));
15
16 FEATURES[key] = Object.freeze(value);
17 });
18
19module.exports = Object.freeze(FEATURES);