Modules@robinpath/yaml
@robinpath/yaml
0.1.0PublicParse, stringify, and manipulate YAML data
@robinpath/yaml
Parse, stringify, and manipulate YAML data
Why use this module?
The yaml module lets you:
- Parse a YAML string into a JavaScript object, array, or value
- Convert a JavaScript value into a YAML string
- Read and parse a YAML file from disk
- Write a value as YAML to a file on disk
- Parse a multi-document YAML string into an array of documents
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/yaml
Quick Start
No credentials needed — start using it right away:
yaml.stringify $data
Available Functions
| Function | Description |
|---|---|
yaml.parse | Parse a YAML string into a JavaScript object, array, or value |
yaml.stringify | Convert a JavaScript value into a YAML string |
yaml.parseFile | Read and parse a YAML file from disk |
yaml.writeFile | Write a value as YAML to a file on disk |
yaml.parseAll | Parse a multi-document YAML string into an array of documents |
yaml.isValid | Check whether a string is valid YAML |
yaml.get | Parse YAML and retrieve a nested value by dot-path |
yaml.toJSON | Convert a YAML string to a JSON string |
yaml.fromJSON | Convert a JSON string to a YAML string |
Examples
Convert a JavaScript value into a YAML string
yaml.stringify $data
Read and parse a YAML file from disk
yaml.parseFile "config.yaml"
Write a value as YAML to a file on disk
yaml.writeFile "output.yaml" $data
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/yaml";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
yaml.stringify $data
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.0 | latest | yesterday |
Related Modules
utilities
1
@dev-tester/hello-world
v2.0.0dev-tester
Updated description
0 downloads
...
utilities
0
@robinpath/apollo
v0.1.1robinpath
Apollo module for RobinPath.
0 downloads
...
utilities
0
@robinpath/archive
v0.1.1robinpath
Create and extract .zip and .tar.gz file archives
0 downloads
...
utilities
0
@robinpath/assert
v0.1.1robinpath
Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more
0 downloads
...
Install
$ robinpath install @robinpath/yaml Version0.1.0
LicenseMIT
Unpacked Size4.3 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

