Export schemas as module

This commit is contained in:
basti committed 2017-06-05 16:19:36 +02:00
1 parent 50c46b4b41
commit 9e8b070489
1 file changed
+15
+15
View File
@@ -0,0 +1,15 @@
const fs = require('fs');
const path = require('path');
let collection = {};
let schemas = [
"contributor",
"contribution"
];
schemas.forEach((schema) => {
let filePath = path.join(__dirname, 'schemas', `${schema}.json`);
collection[schema] = JSON.parse(fs.readFileSync(filePath));
});
module.exports = collection;