1.0.20 • Published 2 years ago

ezpotd v1.0.20

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Simple, lightweight, easy to use, database stored locally for text heavy data. The methods below are tailored towards a specific project, but they may be useful in other use cases. Great for amateur projects. Probably contains errors.

Constructor example

db = new ezpotd(["field1", "field2", "field3", "fieldn"], "specialdirectoryforproject")

I advise that index.js and the directory are at the same level, to avoid creating a mess in the main project directory. One directory per database.

Booting

If the database already has values stored locally, use db.boot(); to recover data.

Adding Entry

db.add(["data1", "data2", "data3", "datan"]);

Querying Data

var results = db.query(["data1","data3"],["field1", "field3"]);

One can query as many or as little fields as they would like, and the result will be an array of indices that match the data fields.

Retrieving Data

var result = db.retrieve("field2",0);

Takes field and index parameter.

Deleting Entry

db.del(0);

Takes index parameter.

Editing Data

db.edit("field1", 0, "value0");

Takes field, index, and value parameter.

db.overwrite(["value1", "value2", "value3", "value4"], 0);

Takes array parameter and index parameter.

Misc

db.last(n);

Returns last n indices added.

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

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