Files: dd64a0d510ecc727cffa7698d15154b14189b73c / app / services / index.js
431 bytesRaw
1 | const fs = require('fs') |
2 | const { map, filter, invoker, zip } = require('ramda') |
3 | const { join, basename } = require('path') |
4 | |
5 | const serviceCreatorNames = filter( |
6 | (name) => name !== 'index', |
7 | map( |
8 | basename, |
9 | fs.readdirSync(__dirname) |
10 | ) |
11 | ) |
12 | |
13 | const serviceCreators = zip( |
14 | serviceCreatorNames, |
15 | map( |
16 | (name) => { |
17 | require(join(__dirname, name)) |
18 | }, |
19 | serviceCreatorNames |
20 | ) |
21 | ) |
22 | |
23 | module.exports = serviceCreators |
24 |
Built with git-ssb-web