You can install the JavaScript-Client library using npm:
npm install lonadb-client
To use the LonaDB Client library, follow these steps:
- Import the required modules and classes:
const LonaClient = require("lonadb-client");
- Create an instance of the
LonaDB-Client
class:
const client = new LonaClient(host, port, name, password);
Replace host
, port
, name
, and password
with the appropriate values for your LonaDB Server.
- Use the provided methods to interact with the server:
// Example: Get a list of tables
client.getTables()
.then(tables => {
console.log("List of tables:");
console.log(tables);
})
.catch(error => {
console.error("Error:", error);
});
Retrieves a list of tables available in the database.
Retrieves data from a specified table.
Deletes a table by its name.
Creates a new table with the given name.
Sets a variable within a table to the specified value.
Deletes a variable from a table.
Retrieves the value of a variable from a table.
Retrieves a list of users in the database.
Creates a new user with the given name and password.
Deletes a user by their name.
Checks if the provided password is correct for a given user.
Checks if a user has a specific permission.
Removes a permission from a user.
Retrieves the raw permission data for a user.
Adds a permission to a user.
Create a function which can be executed whenever you want. Just like eval. Content = string of PHP code
Executes the function
Runs the function (must be a string of PHP code) Example: "if($abc === 1234) return 'wtf';" Response: {"success": true, "response": "wtf", "process": processID}
This project is licensed under the GNU Affero General Public License version 3 (GNU AGPL-3.0)