0.0.7 • Published 8 months ago

horae-configure v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Introduction

"horae" is a lightweight JavaScript library that provides methods to easily read JSON files and manipulate data using the set, get, has, and save functions.

Features

  • Read JSON files effortlessly.
  • Modify JSON data using set and get methods.
  • Check if a specific property exists using has.
  • Save the updated JSON data back to the file.

Installation

You can install "horae" via npm:

npm install horae-configure

You can install "horae" via yarn:

yarn add horae-configure

How to use?

You need to first prepare a JSON file in the outermost layer of the project

{
  "position": {
    "x": 1,
    "y": 2
  }
}

and then initialize horae variable

const horae = new Horae<{
  position: {
    x: number;
    y: number;
  };
}>('config');

get method

horae.get('position.x'); // 1
horae.get('position.y'); // 2

has method

horae.has('position.x'); // true
horae.has('position.y'); // true
horae.has('position.z'); // false

set method

horae.set('position.x', 100);
horae.get('position.x'); // 100

save method

horae.set('position.', 100);
horae.save();

Go back and view the JSON file

{
  "position": {
    "x": 1000,
    "y": 2
  }
}
0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago