Export schemas as module

This commit is contained in:
Basti 2017-06-05 16:19:36 +02:00
parent 50c46b4b41
commit 9e8b070489

15
index.js Normal file
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;