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 antares-protocol
with all npm
packages installed. Try it out:
const { Agent, after } = require("antares-protocol")
const agent = new Agent()
const log = (...args) => console.log(...args)
// All actions sent through .process pass through filters
agent.addFilter(() => log("Good morning."))
// Assign a renderer to fire upon events of `type: 'hello'`.
// After 50ms, the agent will log to the console,
// at which point the Promise `result.completed.hello` will resolve.
agent.on("hello", () => {
return after(50, () => {
log("Hello World!")
})
})
// Process an action to set off our renderer
const result = agent.process({ type: "hello" })
result.completed.then(r => log("Good night."))
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.