--> 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:
And writes the data:
Both of those functions contains an options parameter that implements, the Options interface. Options interface looks like this:
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):
Secondly, create an IUser interface and specify the type for every field:
Thirdly, read data or write data to the file.
Reading data:
Writing data:
Array
Object
type: single
type: array
THE END
That's it.