Socket
Socket
Sign inDemoInstall

horae-configure

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    horae-configure

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


Version published
Weekly downloads
1
Maintainers
1
Install size
7.38 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 17 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc