1.0.7 • Published 4 years ago

@daisydogs07/simpledatabase v1.0.7

Weekly downloads
415
License
ISC
Repository
github
Last release
4 years ago

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

4 years ago

1.0.6

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.5

4 years ago

1.0.448

4 years ago

1.0.447

4 years ago

1.0.446

4 years ago

1.0.445

4 years ago

1.0.444

4 years ago

1.0.443

4 years ago

1.0.442

4 years ago

1.0.431

4 years ago

1.0.441

4 years ago

1.0.432

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.31

4 years ago

1.0.41

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago