Modules@robinpath/config

@robinpath/config

0.1.0Public

Multi-source configuration management with deep merge, dot-path access, env loading, and validation

@robinpath/config

Multi-source configuration management with deep merge, dot-path access, env loading, and validation

Category Functions Auth License

Why use this module?

The config module lets you:

  • Create config with defaults
  • Load config from file (.json, .env)
  • Load from environment variables
  • Get config value by dot path
  • Get entire config

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/config

Quick Start

No credentials needed — start using it right away:

config.load "./config.json"

Available Functions

FunctionDescription
config.createCreate config with defaults
config.loadLoad config from file (.json, .env)
config.loadEnvLoad from environment variables
config.getGet config value by dot path
config.setSet config value by dot path
config.getAllGet entire config
config.mergeDeep merge into config
config.hasCheck if path exists
config.removeRemove config key
config.clearClear entire config
config.listList all config names
config.validateValidate required keys exist
config.freezeFreeze config (immutable)
config.toEnvConvert config to env format

Examples

Load config from file (.json, .env)

config.load "./config.json"

Load from environment variables

config.loadEnv "APP_"

Get config value by dot path

config.get "database.host" "localhost"

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/config";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  config.load "./config.json"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/config
Version0.1.0
LicenseMIT
Unpacked Size5.4 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities