🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/json

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/json

JSON manipulation: parse, stringify, deep merge, flatten, unflatten, diff, query by path, pick, and omit

latest
npmnpm
Version
0.3.0
Version published
Weekly downloads
15
66.67%
Maintainers
4
Weekly downloads
 
Created
Source

@robinpath/json

JSON manipulation: parse, stringify, deep merge, flatten, unflatten, diff, query by path, pick, and omit

Category Functions Auth License

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

robinpath add @robinpath/json

Quick Start

No credentials needed — start using it right away:

json.stringify $obj

Available Functions

FunctionDescription
json.parseParse a JSON string into an object
json.stringifyConvert a value to a JSON string
json.getGet a nested value by dot-separated path
json.setSet a nested value by dot-separated path, returning a new object
json.mergeDeep merge two or more objects
json.flattenFlatten a nested object to dot-notation keys
json.unflattenUnflatten dot-notation keys back to a nested object
json.diffCompare two objects and return differences
json.cloneDeep clone an object
json.isValidCheck if a string is valid JSON
json.keysGet all keys including nested paths with dot notation
json.pickPick specific keys from an object
json.omitOmit 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

Keywords

json

FAQs

Package last updated on 06 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts