Crosswalk
Crosswalk maps one JSON shape onto another. The shape you have goes on the left, the shape you want goes on the right, and you draw the lines between them. A line straight across copies a field. A line through an operator changes it on the way, such as joining two names, comparing a value or adding up a list.
This map takes a person and their phone calls and builds a profile. It joins the first and last name, works out an age, only copies the zip code when it's a number, and totals the calls into national and international.
The packages
| Package | What it does |
|---|---|
@crosswalkjs/core | Holds the map format and the operators, checks maps and runs them. No UI and no dependencies, so it runs in Node or the browser. |
@crosswalkjs/canvas | The editor above. Plain DOM, so it works with any framework or none. |
Crosswalk.Core | Runs maps in .NET 8 and later, with the same behaviour as the JavaScript core. See Running maps in .NET. |
The editor saves a map as plain JSON. You can keep it in git, load it on a server and run it there with only the core package, in JavaScript or .NET.
What it doesn't do
Crosswalk is at 0.1. The map format is versioned ("version": 1), but the JavaScript API may still change before 1.0. It reads JSON Schema for shape (type, properties, items, required and local $refs), not for validation, so rules such as pattern or minimum are ignored, and a $ref to another file isn't followed.
Where to go next
- Getting started installs the packages and runs a first map.
- The map document and How a map runs cover the format and its rules.
- Frameworks has a ready-made editor component for each major framework.
- The playground has the editor on its own page, with every theme.