Modules@robinpath/json
@robinpath/json
0.1.0PublicJSON manipulation: parse, stringify, deep merge, flatten, unflatten, diff, query by path, pick, and omit
@robinpath/json
JSON manipulation: parse, stringify, deep merge, flatten, unflatten, diff, query by path, pick, and omit
Why use this module?
The json module lets you:
- Parse a JSON string into an object
- Convert a value to a JSON string
- Get a nested value by dot-separated path
- Deep merge two or more objects
- Flatten a nested object to dot-notation keys
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/json
Quick Start
No credentials needed — start using it right away:
json.stringify $obj
Available Functions
| Function | Description |
|---|---|
json.parse | Parse a JSON string into an object |
json.stringify | Convert a value to a JSON string |
json.get | Get a nested value by dot-separated path |
json.set | Set a nested value by dot-separated path, returning a new object |
json.merge | Deep merge two or more objects |
json.flatten | Flatten a nested object to dot-notation keys |
json.unflatten | Unflatten dot-notation keys back to a nested object |
json.diff | Compare two objects and return differences |
json.clone | Deep clone an object |
json.isValid | Check if a string is valid JSON |
json.keys | Get all keys including nested paths with dot notation |
json.pick | Pick specific keys from an object |
json.omit | Omit specific keys from an object |
Examples
Convert a value to a JSON string
json.stringify $obj
Get a nested value by dot-separated path
json.get $obj "user.name"
Set a nested value by dot-separated path, returning a new object
json.set $obj "user.name" "Bob"
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/json";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
json.stringify $obj
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
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/json Version0.1.0
LicenseMIT
Unpacked Size5.2 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

