An open API service indexing awesome lists of open source software.

https://github.com/caiogondim/logdown-cast.js

:satellite: Subscribe to a remote logdown instance
https://github.com/caiogondim/logdown-cast.js

javascript logdown nodejs

Last synced: 2 months ago
JSON representation

:satellite: Subscribe to a remote logdown instance

Awesome Lists containing this project

README

        

# logdown-cast


 


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

## Installation

```bash
npm install logdown-cast --save
```

## Usage

```js
// 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, ...

```js
// 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](https://github.com/caiogondim/logdown.js#enablingdisabling-instances).

## Preview



## Reference and credits
- Icon created by Jamison Wieser from The Noun Project
- [logdown](https://github.com/caiogondim/logdown.js)
- [localcast](https://github.com/mafintosh/localcast)

---

[caiogondim.com](https://caiogondim.com)  · 
GitHub [@caiogondim](https://github.com/caiogondim)  · 
Twitter [@caio_gondim](https://twitter.com/caio_gondim)