This package contains various tools for working with Realm files. Each tool is briefly documented here.
The prerequisite for installing the @realm/tools
package is a working node.js and a package manager.
npm:
npm install -g @realm/tools
yarn:
yarn global add @realm/tools
Source code for all tools are found in src
. The output of the build process is found in dist
.
npm install
npm run build
You can run the transpiled tools directly e.g.,
node dist/realm-schema.js -h
The realm-schema
can read a local Realm file and export the schema. The support output formats are:
- JSON
- Mermaid compatible class diagram
Example:
npx realm-schema -i samples/default.realm -o MyClasses.mmd -f mermaid
The output will look like
classDiagram
class Child {
+string name
+int age
}
class Parent {
+string name
+string city
+Parent marriedTo
+list~Child~ children
}
Parent <-- Parent
Child <-- Parent
If you plan to use the JSON output, it is recommended to use it with jq.