Skip to content

caiogondim/logdown-cast.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logdown-cast

 

Subscribe to a remote logdown instance in the same machine. Works between different Node processes and browser tabs.

Installation

npm install logdown-cast --save

Usage

// 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.

Preview

Reference and credits


caiogondim.com  ·  GitHub @caiogondim  ·  Twitter @caio_gondim

About

📡 Subscribe to a remote logdown instance

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published