firestore

Firebase implementation of a simple key/value store

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
firestore
311.1.68 years ago8 years agoMinified + gzip package size for firestore in KB

Readme

firestore
Firebase implementation of a simple key/value store

Install

npm install firestore --save

Examples

Del key

var Firestore = require('firestore')

new Firestore({ name: 'pub' }, function firestoreInitialized(err, firestore) {
  if (err) {
    console.log('ERROR', err)
    process.exit(1)
  }
  firestore.del('somewhere', function(err) {
    if (!err) console.log('unexpected')
    process.exit(0)
  })
})

Get key

var Firestore = require('firestore')

new Firestore({ name: 'pub', path: 'AWS/zone/ap-northeast-1' }, function firestoreInitialized(err, firestore) {
  if (err) {
    console.log('ERROR', err)
    process.exit(1)
  }
  firestore.get('city', function(err, value) {
    console.log((err) ? err.code : value)
    process.exit(0)
  })
})

Set value

var Firestore = require('firestore')

new Firestore({ name: 'pub' }, function firestoreInitialized(err, firestore) {
  if (err) {
    console.log('ERROR', err)
    process.exit(1)
  }
  firestore.set('somewhere', 'value', function(err) {
    if (!err) console.log('unexpected')
    process.exit(0)
  })
})
Inspiriation
callback free harmonious node

License: MIT