1.0.3 • Published 5 years ago

firebase-counter v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Build Status js-standard-style

firebase-counter

Counter with firebase backend

Installation

$ npm i firebase-counter

Usage

Add, subtract og lookup values for a specific key in firebase.

  • Uses value as key if no key supplied.
  • Defaults to 1 if no value is presented.
  • Supports promises and callbacks
const fbc = require('firebase-counter')
const counterOptions = {
  apiKey: '<your-api-key>',
  authDomain: '<your-auth-domain>',
  databaseURL: '<your-database-url>',
  appName: '<your-app-name>',
  authEmail: '<your-auth-email>',
  authPassword: '<your-auth-password>'
}

const counter = fbc(counterOptions)

counter.add({'key': 'fishy', value: 10}).then(data => console.log(data))

counter.subtract({'key': 'fishy', value: 5}).then(data => console.log(data))

counter.lookup({'key': 'fishy'}).then(data => console.log(data))

License

MIT

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago