๐ Secure โ๏ธ Synchronized โก๏ธ Realtime โ๏ธ Cloud ๐ Native JavaScript Variables & Events
V extends your in-memory variables to also be saved/persisted instantly. Variables are instantly synchronized between all running instances of V in a room. When you (re)start in a room, variables and constants are reloaded/rehydrated automatically.
- Keep your variables in the cloud
- Sync variables between instances
- Automatic reloaded/rehydrated on start-up
- Web GUI
- History - Time machine
- Events pub/sub
npm install --save v
or
npm i -S v
jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/v@latest/v.min.js"></script>
Unpkg CDN:
<script src="https://unpkg.com/v/v.min.js"></script>
More CDNs coming soon
If no roomId is passed, a new one will be assigned automatically and printed in the console.
const V = require('v')
const v = new V([roomId])
const V = require('v')
V([roomId,] v => {
...
})
const V = require('v')
V([roomId]).then(v => {
...
}).catch(e => {
...
})
The opts
object has the following options and their default options listed
myOpts = {
roomId: '',
server: 'ws(s)://my-domain.com'
}
Use it:
const v = new V(myOpts)
V comes with extensive debugging logs. Each V instance and constructor-call has it own debug namespace.
In node, enable debug logs by setting the DEBUG
environment variable to *
DEBUG=* node myProgram.js
In the browser, enable debug logs by running this in the developer console:
localStorage.debug = '*'
Disable by running this:
localStorage.removeItem('debug')
MIT Copyright ยฉ Diego Rodrรญguez Baquero