index.js
function createTable() {
    tableName = arguments[0];
    var fname = '';
    var callback;
    if (arguments.length === 2) {

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

    // Check if the file with the tablename.json exists
    let exists = fs.existsSync(fname);

    if (exists) {
        // The file exists, do not recreate the table/json file
        callback(false, tableName + '.json already exists!');
        return;
    } else {
        // Create an empty object and pass an empty array as value
        let obj = new Object();
        obj[tableName] = [];

        // Write the object to json file
        try {
            fs.writeFileSync(fname, JSON.stringify(obj, null, 2), (err) => {

            })
            callback(true, "Success!")
            return;
        } catch (e) {
            callback(false, e.toString());
            return;
        }

    }
}
function createTable() {
    tableName = arguments[0];
    var fname = '';
    var callback;
    if (arguments.length === 2) {

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

    // Check if the file with the tablename.json exists
    let exists = fs.existsSync(fname);

    if (exists) {
        // The file exists, do not recreate the table/json file
        callback(false, tableName + '.json already exists!');
        return;
    } else {
        // Create an empty object and pass an empty array as value
        let obj = new Object();
        obj[tableName] = [];

        // Write the object to json file
        try {
            fs.writeFileSync(fname, JSON.stringify(obj, null, 2), (err) => {

            })
            callback(true, "Success!")
            return;
        } catch (e) {
            callback(false, e.toString());
            return;
        }

    }
}
Create a table | a json file
The second argument is optional, if ommitted, the file
will be created at the default location.
@param  {[string]} arguments[0] [Table name]
@param {[string]} arguments[1] [Location of the database file] (Optional)
@param {[function]} arguments[2] [Callbak ]
 function createTable(tableName, callback) {