Subscribe to a remote logdown instance in the same machine. Works between different Node processes and browser tabs.
npm install logdown-cast --save
// Publish
const logdown = require('logdown')
const cast = require('logdown-cast')
const debug = logdown('foo')
cast.publish(debug)
// Will be published
setInterval(() => debug.log('Hi', Date.now()), 1000)
Then in another process, browser, ...
// Subscribe
const logdown = require('logdown')
const cast = require('logdown-cast')
// Create a logdown object with the prefix you want to subscribe
cast.subscribe(logdown('foo'))
The subscribed instance is a regular logdown instance, which means that you will need to enable logging for it.
caiogondim.com · GitHub @caiogondim · Twitter @caio_gondim