1.0.11 • Published 1 year ago

jsondata-io v1.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

--> npm i jsondata-io <--

WHAT IS THIS

JsonData-IO provides IO functionalities, that allows you to read data, and write data to .json files.

HOW IT WORKS

JsonData-IO gives you two functions that reads the data:

readData

And writes the data:

writeData

Both of those functions contains an options parameter that implements, the Options interface. Options interface looks like this:

interface

HOW TO USE IT

Let's say we want to store data about users

Firstly, create "users.json" file and give some dummy data (or leave it with an empty array):

file_structure json

Secondly, create an IUser interface and specify the type for every field:

interface_User

Thirdly, read data or write data to the file.

Reading data:

readData_full

Writing data:

Array

writeData_full

Object

writeData_full_obj

type: single

writeData_full_single

type: array

writeData_full_array

THE END

That's it.

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago