v
Secure, Synchronized, Realtime, Cloud, Native JavaScript Variables & Events
Last updated 8 years ago by diegorbaquero .
GPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install v 
SYNC missed versions from official npm registry.

V Logo

🔒 Secure ❄️ Synchronized ⚡️ Realtime ☁️ Cloud 🌈 Native JavaScript Variables & Events

npm downloads Greenkeeper badge Build Status codecov bitHound Overall Score
NSP Status Known Vulnerabilities

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.

Current Features

  • Keep your variables in the cloud
  • Sync variables between instances
  • Automatic reloaded/rehydrated on start-up

Requires ES6 Proxy (Node 6+ and new browsers)

Coming Soon:

  • Web GUI
  • History - Time machine
  • Events pub/sub

Install

Node

npm install --save v
or
npm i -S v

Browser

Unpkg CDN:

<script src="https://unpkg.com/v/v.min.js"></script>

More CDNs coming soon

API

Constructor (3 Ways to do it)

If no roomId is passed, a new one will be assigned automatically and printed in the console.

NodeJS only with deasync support
const V = require('v')
const v = new V([roomId])
Callback
const V = require('v')
V([roomId,] v => {

})
Promise
const V = require('v')
V([roomId]).then(v => {

}).catch(e => {

})

Custom Opts

The opts object has the following options and their default options listed

myOpts = {
  roomId: '',
  server: 'wss://api.online.vars'
}

Use it:

const v = new V(myOpts)

Debug logs

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')

License

GPL-3.0 Copyright © Diego Rodríguez Baquero

Current Tags

  • 0.3.0                                ...           latest (8 years ago)

14 Versions

  • 0.3.0                                ...           8 years ago
  • 0.2.5                                ...           8 years ago
  • 0.2.4                                ...           8 years ago
  • 0.2.3                                ...           8 years ago
  • 0.2.2                                ...           8 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.4 [deprecated]           ...           8 years ago
  • 0.1.2 [deprecated]           ...           8 years ago
  • 0.1.1 [deprecated]           ...           8 years ago
  • 0.1.0 [deprecated]           ...           8 years ago
  • 0.0.10 [deprecated]           ...           8 years ago
  • 0.0.9 [deprecated]           ...           12 years ago
  • 0.0.1 [deprecated]           ...           12 years ago
Maintainers (1)
Downloads
Total 13
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE