1.0.16 • Published 5 years ago

lazyjsonstorage v1.0.16

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

This is a module that makes storing data on json files easier

How this works

Require

var lazyjson = require("lazyjsonstorage")
var file = new lazyjson.JSONfile("test.json")

Insert

Inserts an object in the file.

JSONfile.insert(object)

Search

Searches for (an) object(s) in the file.

console.log(JSONfile.search("key","value"))
console.log(JSONfile.search("key",""))
console.log(JSONfile.search("","value"))

console.log(JSONfile.search(object))

console.log(JSONfile.search(array[object,object...]))
//you can serialize searches

returns an array with the object(s) found

Remove

Removes (an) object(s) from the file.

JSONfile.remove("key","value",number)
JSONfile.remove("key","",number)
JSONfile.remove("","value",number)

JSONfile.remove(object,number)

returns the number of object(s) deleted

Edit

Edits (an) object(s) property(ies) in the file.

JSONfile.edit(object,object)

JSONfile.edit(array[object,object...],object)

/*the first argument is the object to edit and the second 
argument is the property(ies) to change*/

returns the number of object(s) edited

1.0.16

5 years ago

1.0.14

5 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago