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

chia-root-resolver

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chia-root-resolver

Small utility to return the Chia Root, uses CHIA_ROOT if it exists, otherwise defaults to default Chia Root

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Chia Root Resolver

Chia Root Resolver is a simple module designed to resolve the path of the Chia Blockchain in your system. This module is useful for creating scripts or applications that interact with Chia Blockchain's files.

Installation

Using npm:

npm install chia-root-resolver

Usage

Here is a basic example on how to use this module:

const { getChiaRoot } = require('chia-root-resolver');

console.log(getChiaRoot()); // Outputs: The path to your Chia Blockchain root.

This module provides the getChiaRoot function, which returns the root directory of the Chia Blockchain in your system. If the CHIA_ROOT environment variable is set, getChiaRoot returns the absolute path specified by this variable. If CHIA_ROOT isn't set, getChiaRoot assumes that Chia Blockchain's root directory is ~/.chia/mainnet and returns the absolute path to this directory.

This function uses memoization, meaning it calculates the root directory's path the first time you call it and then returns the cached path in subsequent calls. This design improves performance when you call getChiaRoot multiple times.

License

MIT License. See the LICENSE file for more details.

Keywords

FAQs

Package last updated on 08 Aug 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