Sign Up for Free

RunKit +

Try any Node.js package right in your browser

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 @peetertomberg/registry with all npm packages installed. Try it out:

const registry = require("@peetertomberg/registry"); const instance = registry.createRegistry(); const callback = (...args) => console.log(...args); // Triggered when a key is registered instance.eventBus.on(instance.events.REGISTER, callback); // Triggered when a key is unregistered instance.eventBus.on(instance.events.UNREGISTER, callback); console.log('Will log out key and value to console from event register'); instance.register('key', 'value'); console.log('Will log out key from event unregister'); instance.unregister('key');

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@peetertomberg/registry v1.0.3

Basically a library to create a typed key-value store with an event emitter.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free