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
- Host: GitHub
- URL: https://github.com/caiogondim/logdown-cast.js
- Owner: caiogondim
- Created: 2017-06-16T10:25:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T00:20:56.000Z (about 7 years ago)
- Last Synced: 2025-04-03T00:32:14.580Z (2 months ago)
- Topics: javascript, logdown, nodejs
- Language: JavaScript
- Homepage:
- Size: 8.85 MB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)