gh-db-installer
Version:
This module helps you to install the gh-db
20 lines (19 loc) • 476 B
JavaScript
// add modules
const fs = require('fs');
const path = require('path');
let readJson = function (dirPath, name) {
try {
// read and parse file
let file = fs.readFileSync(path.join(__dirname, '../file_sistem', dirPath, name), 'utf8');
let returnFile = JSON.parse(file);
return(returnFile);
}
catch (err){
return({
message: "Can not read file",
err: err
});
}
}
//exports
module.exports = readJson;