1.1.1 • Published 12 months ago

@rmtc/config v1.1.1

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

@rmtc/config

Configuration loading, parsing, and validation for the @rmtc/toolchain CLI.

!WARNING This package is intended for internal use by @rmtc/toolchain. It's probably not useful by itself.

!WARNING This project is intended for use in @rowanmanning's projects. It's free to use but I don't offer support for use-cases outside of what I need.

Table of Contents

Requirements

This library requires the following to run:

Usage

Install the module with npm:

npm install @rmtc/config

Read a valid .rmtc.json5 config file with:

const {Config} = require('@rmtc/config');
await Config.fromFile(`/path/to/project/directory`);

There's no need to include .rmtc.json5 in the file path, it's added automatically.

The above function will throw an error if:

  • There is no config file
  • The config file is not valid JSON5
  • The config file does not match the config schema

Contributing

See the central README for a contribution guide and code of conduct.

License

Licensed under the MIT license. Copyright © 2023, Rowan Manning