1.0.26 • Published 1 year ago

@awesomelewis2007/jsondb v1.0.26

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
1 year 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.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago