1.0.25 • Published 1 month ago

@awesomelewis2007/jsondb v1.0.25

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
1 month ago

JSONdb

Create databases using JSON

Usage

const JSONdb = require('@awesomelewis2007/jsondb');

const db = new JSONdb('example.json');

// Initialize a new database
// db.init(name, description)
db.init('example database', 'This is an example database');

// Append data to the database
// db.append(data, id=NaN)
db.append(["A", "B", "C"])
// If you want to specify an id, you can do so
db.append(["A", "B", "C"], 1)
// If the id already exists, JSONdb will throw a warning and set a id that doesn't exist

// Write to a specific id
// db.write(id, data)
db.write(1, ["A", "B", "C"])

// Read from a specific id
// db.read(id)
db.read(1)

// Delete a specific id
// db.delete(id)
db.delete(1)

// List all ids and their data
// db.list(path)
db.list('example.json')

// Clear the database
// db.clear(path)
db.clear('example.json')

// Check if the database exists
// db.exists(path)
db.exists('example.json')

Installation

npm install @awesomelewis2007/jsondb

Licence

This project is licensed under the GNU GPLv3 License - see the LICENCE file for details

1.0.25

1 month ago

1.0.24

3 months ago

1.0.23

4 months ago

1.0.22

9 months ago

1.0.21

10 months ago

1.0.20

10 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.9

11 months ago

1.0.8

12 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago