jsondata-io
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

--> 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.

/jsondata-io/

    Package Sidebar

    Install

    npm i jsondata-io

    Weekly Downloads

    1

    Version

    1.0.11

    License

    ISC

    Unpacked Size

    5.58 kB

    Total Files

    5

    Last publish

    Collaborators

    • slawuskox