1.0.7 • Published 5 years ago
@daisydogs07/simpledatabase v1.0.7
Welcome!
This is my simple database, A database that uses fs.
Requiring and creating a database
const Database = require('@daisydogs07/simpledatabase');
const database = new Database('database');
Methods
add(path, value)
Adds a specified amount to the JSON value
- Path: The path to the JSON key *
- Value: The amount to add. Defaults to 1
- Returns: A reference to the Database
sub(path, value)
Subtracts a specified amount to the JSON value
- Path: The path to the JSON key *
- Value: The amount to subtract. Defaults to 1
- Returns: A reference to the Database
set(path, value)
Sets a JSON value to the new value
- Path: the path to the JSON key *
- Value: The value to set *
- Returns: A reference to the Database
delete(path)
Deletes a JSON key
- Path: The path to the JSON key (Required)
- Returns: A reference to the Database
get(path)
Gets the specified JSON key's value
- Path: The path to the JSON key
- Returns: The JSON value of the JSON key
read()
Reads the JSON Object from the database file
- Returns: The JSON object
* = Required
Events
- Err: This event is triggered when you encounter an error. If theres no listener for this event, An error is thrown.
- Change: This event is triggered when the database file is changed by a method.
Install now
npm i @daisydogs07/simpledatabase
1.0.7
5 years ago
1.0.6
5 years ago
1.0.62
5 years ago
1.0.61
5 years ago
1.0.5
5 years ago
1.0.448
5 years ago
1.0.447
5 years ago
1.0.446
5 years ago
1.0.445
5 years ago
1.0.444
5 years ago
1.0.443
5 years ago
1.0.442
5 years ago
1.0.431
5 years ago
1.0.441
5 years ago
1.0.432
5 years ago
1.0.44
5 years ago
1.0.43
5 years ago
1.0.42
5 years ago
1.0.31
5 years ago
1.0.41
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago