Modules@robinpath/diff

@robinpath/diff

0.1.0Public

Text 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

Category Functions Auth License

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

FunctionDescription
diff.linesDiff two strings line by line
diff.charsDiff two strings character by character
diff.wordsDiff two strings word by word
diff.objectsDiff two objects
diff.arraysDiff two arrays
diff.patchApply a line diff to produce the new string
diff.unifiedGenerate unified diff format (like git diff)
diff.isEqualDeep equality check
diff.statsGet 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

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/diff
Version0.1.0
LicenseMIT
Unpacked Size4.4 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities