1.1.0 • Published 3 years ago

@srzorro/file-json v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

file-json

npm i @srzorro/file-json

For when you want to store stuff in a json file, but also want to read and write it easily.

Usage

import FileJson from "@srzorro/file-json";

interface IJson {
    name: string;
    version: string;
    isEnabled: boolean;
}

const json = new FileJson<IJson>("config.json");

(async () => {
    // Read
    await json.r();

    // Data container
    console.log(json.d);

    // Edit data
    json.d.isEnabled = true;

    // Write
    await json.w();
})();
1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago