Modules@robinpath/diff
@robinpath/diff
0.1.0PublicText and data diffing: line, word, character, object, and array diffs with unified output
@robinpath/diff
Text and data diffing: line, word, character, object, and array diffs with unified output
Why use this module?
The diff module lets you:
- Diff two strings line by line
- Diff two strings character by character
- Diff two strings word by word
- Diff two objects
- Diff two arrays
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/diff
Quick Start
No credentials needed — start using it right away:
diff.chars "cat" "car"
Available Functions
| Function | Description |
|---|---|
diff.lines | Diff two strings line by line |
diff.chars | Diff two strings character by character |
diff.words | Diff two strings word by word |
diff.objects | Diff two objects |
diff.arrays | Diff two arrays |
diff.patch | Apply a line diff to produce the new string |
diff.unified | Generate unified diff format (like git diff) |
diff.isEqual | Deep equality check |
diff.stats | Get diff statistics from a diff result |
Examples
Diff two strings character by character
diff.chars "cat" "car"
Diff two strings word by word
diff.words $old $new
Diff two objects
diff.objects $obj1 $obj2
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/diff";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
diff.chars "cat" "car"
`);
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/diff Version0.1.0
LicenseMIT
Unpacked Size4.4 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

