dbcopycat
Version:
A JSON Database that saves your Json data in a file and makes it easy for you to perform CRUD operations.
18 lines (16 loc) • 351 B
JavaScript
const fs = require('fs');
function statPath(path) {
try {
return fs.statSync(path);
} catch (ex) { }
return false;
}
function dataControl() {
var exist = statPath('./data/db.json');
if (exist && exist.isFile()) {
return true
} else {
return false
}
}
module.exports = dataControl;