index.js
function getAll() {
    var fname = '';
    var callback;
    var tableName = arguments[0];

    if (arguments.length === 2) {
        fname = path.join(userData, tableName + '.json');
        callback = arguments[1];
    } else if (arguments.length === 3) {
        fname = path.join(arguments[1], arguments[0] + '.json');
        callback = arguments[2];
    }

    let exists = fs.existsSync(fname);

    if (exists) {
        try {
            let table = JSON.parse(fs.readFileSync(fname));
            callback(true, table[tableName]);
            return;
        } catch (e) {
            callback(false, []);
            return;
        }
    } else {
        callback(false, 'Table file does not exist!');
        return;
    }
}
function getAll() {
    var fname = '';
    var callback;
    var tableName = arguments[0];

    if (arguments.length === 2) {
        fname = path.join(userData, tableName + '.json');
        callback = arguments[1];
    } else if (arguments.length === 3) {
        fname = path.join(arguments[1], arguments[0] + '.json');
        callback = arguments[2];
    }

    let exists = fs.existsSync(fname);

    if (exists) {
        try {
            let table = JSON.parse(fs.readFileSync(fname));
            callback(true, table[tableName]);
            return;
        } catch (e) {
            callback(false, []);
            return;
        }
    } else {
        callback(false, 'Table file does not exist!');
        return;
    }
}
Get all contents of the table/json file object
@param  {string} arguments[0] [Table name]
@param  {string} arguments[1] [Location of the database file] (Optional)
@param  {Function} arguments[2]  [callback function]
 function getAll(tableName, callback) {