This page is work-in-progress. You can reach me on twitter or mail to

Playground - Data

Playground can load text or json data from another file.


This will look into data/example.json

JSON will get parsed and saved as an object - which you can easily access:

Text data


This will look for data/example.txt and will not attempt to parse it as a JSON

Merging data

Playground will merge data that is put in subsequent folders.

this.loadData("items", "items/weapons", "items/food");

This will look for

data/items.json data/items/weapons.json data/items/food.json

And put them into one object overwriting repeated keys

If the root doesn't exist an empty object will be created and overwritten:

/* that's legit */

this.loadData("items/weapons", "items/food");

This also works for text files in which case they will get concatenated.

Ask question:

Fork me on GitHub