Modules@robinpath/toml

@robinpath/toml

0.1.0Public

Parse, stringify, and manipulate TOML configuration files

@robinpath/toml

Parse, stringify, and manipulate TOML configuration files

Category Functions Auth License

Why use this module?

The toml module lets you:

  • Parse a TOML string to object
  • Convert object to TOML string
  • Read and parse a TOML file
  • Write object as TOML to file
  • Get nested value by dot path from TOML string

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

Installation

npm install @robinpath/toml

Quick Start

No credentials needed — start using it right away:

toml.stringify $config

Available Functions

FunctionDescription
toml.parseParse a TOML string to object
toml.stringifyConvert object to TOML string
toml.parseFileRead and parse a TOML file
toml.writeFileWrite object as TOML to file
toml.getGet nested value by dot path from TOML string
toml.isValidCheck if string is valid TOML
toml.toJSONConvert TOML string to JSON string
toml.fromJSONConvert JSON string to TOML string

Examples

Convert object to TOML string

toml.stringify $config

Read and parse a TOML file

toml.parseFile "config.toml"

Write object as TOML to file

toml.writeFile "config.toml" $obj

Integration with RobinPath

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

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

const result = await rp.executeScript(`
  toml.stringify $config
`);

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/toml
Version0.1.0
LicenseMIT
Unpacked Size3.6 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities