This is a playground
to test code. It runs a full Node.js
environment and already has all of npm
’s 1,000,000+ packages pre-installed, including data-path-store
with all npm
packages installed. Try it out:
// Get the store
var store = require("data-path-store");
store = new store();
// Setup update listener
store.on("change", function(val)
{
console.log(val);
});
// Add function for generating data
store.setData("clicheGreetings", "hello", function(params, cb)
{
return "Hello, " + params + "!";
});
// Have some fun
var thor = await store.getData("clicheGreetings", "hello", "Thor"); // Hello, Thor!
var loki = await store.getData("clicheGreetings", "hello", "Loki"); // Hello, Loki!
var oNeill = await store.getData("clicheGreetings", "hello", "O'Neill"); // Hello, O'Neill!
// Cache them as an array in the store (Trigers update function above)
store.setData("greetings", "people", [thor.data, loki.data, oNeill.data]);
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.