Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chia-config-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chia-config-loader

Load Chia config.yaml into an abject to read from

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Chia Config Loader

chia-config-loader is a simple utility that allows you to load Chia's configuration file in your project. This is the file thats located at //config/config.yaml leverages memoization to optimize loading the configuration, ensuring that the file is read only once during the lifetime of your application.

If you have a system variable called CHIA_ROOT it will use this to locate the file. Otherwise it will default to ~/.chia/mainnet

Installation

You can install chia-config-loader using npm:

npm install chia-config-loader

Usage

After importing chia-config-loader into your project, you can easily access Chia's configuration using the provided getChiaConfig function.

Example

Here's how you can use chia-config-loader in your code:

const { getChiaConfig } = require("chia-config-loader");

// Fetch Chia's configuration
const config = getChiaConfig();

// Access any desired configuration property
console.log(config.data_layer.host_port);

Function

getChiaConfig()

Returns the Chia configuration object. The result is memoized, so subsequent calls to getChiaConfig return the same object without re-reading the file.

Dependencies

This module depends on chia-root-resolver to find the root folder of the Chia blockchain software. Ensure that you have this package in your project if you're going to use chia-config-loader.

License

MIT

Keywords

FAQs

Package last updated on 28 Dec 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc