Modules@robinpath/transform
@robinpath/transform
0.1.0PublicData transformation and mapping utilities for RobinPath
@robinpath/transform
Data transformation and mapping utilities: pick, omit, rename, coerce, flatten, merge, pipeline, and more
Why use this module?
The transform module lets you:
- Pick specific keys from an object (supports nested paths with dot notation)
- Create a copy of an object with specific keys removed
- Rename keys in an object
- Apply transformations to specific values in an object
- Coerce a value to a target type
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/transform
Quick Start
No credentials needed — start using it right away:
transform.omit $data ["password", "secret"]
Available Functions
| Function | Description |
|---|---|
transform.pick | Pick specific keys from an object (supports nested paths with dot notation) |
transform.omit | Create a copy of an object with specific keys removed |
transform.rename | Rename keys in an object |
transform.mapValues | Apply transformations to specific values in an object |
transform.coerce | Coerce a value to a target type |
transform.flatten | Flatten a nested object into a single level with dot-notation keys |
transform.unflatten | Unflatten a dot-notation object back into a nested structure |
transform.merge | Deep merge multiple objects (later objects override earlier ones) |
transform.defaults | Fill in missing/null/undefined keys from default values |
transform.template | Render a template string with {{key}} placeholders replaced by data values |
transform.group | Group an array of objects by a key value |
transform.pipeline | Apply a series of transformation steps to data |
transform.mapArray | Map an array of objects to a new shape by specifying target-to-source key mapping |
transform.filter | Filter an array of objects by matching key-value conditions |
transform.sort | Sort an array of objects by a key |
Examples
Create a copy of an object with specific keys removed
transform.omit $data ["password", "secret"]
Rename keys in an object
transform.rename $data {"firstName": "first_name", "lastName": "last_name"}
Apply transformations to specific values in an object
transform.mapValues $data {"age": "toNumber", "name": "trim"}
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/transform";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
transform.omit $data ["password", "secret"]
`);
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/transform Version0.1.0
LicenseMIT
Unpacked Size7.2 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

