Contains a few thoroughly commented examples illustrating how to use the library.
- simple - Defines a struct type and uses it to record the last time the example was run, along with the number of times the example has run in total.
- counter - Displays the value of a key in the realm, increments it by one, and quits. Run the example repeatedly to see the number of times it has been run.
- linked-list - Defines a singly-linked list using a simple struct. Uses the list to record a list of the times the example has been run.
- users-and-roles - A more complicated example, we define some data structures to represent Users and Roles and the relationships between them.
git clone https://github.com/codemix/reign.git
cd reign
npm install
node -v
node examples/simple.js
node examples/counter.js
node examples/linked-list.js
node examples/users-and-roles.js
Run the examples again to ensure that data has been successfully persisted. Files will be created in the data directory (which will be created if it doesn't exist).