keyv-firestore
Firebase Cloud Firestore backend for Keyv, the simple persistent key-value storage module
Last updated 10 months ago by goto-bus-stop .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install keyv-firestore 
SYNC missed versions from official npm registry.

keyv-firestore

Firebase Cloud Firestore backend for Keyv, the simple persistent key-value storage module

Install - Usage - License: Apache-2.0

npm travis standard

Install

npm install keyv-firestore

Usage

keyv-firestore uses nested collections for namespaces and keys. A root collection contains keys for each namespace, and each namespace key contains a single collection that holds key/value pairs. The path to a specific key is root-collection/namespace/namespace/key.

var Keyv = require('keyv')
var KeyvFirestore = require('keyv-firestore')

const keyv = new Keyv({
  store: KeyvFirestore,
  // REQUIRED: the project id to use
  projectId: 'my-firebase-project',
  // REQUIRED: the root collection to store things in
  collection: 'firestore-db-collection'
})

You can set the GOOGLE_APPLICATION_CREDENTIALS environment variable to configure credentials, or pass in a JavaScript object in the credentials option.

const keyv = new Keyv({
  store: KeyvFirestore,
  projectId: 'my-firebase-project',
  collection: 'firestore-db-collection',
  credentials: require('./path/to/google-credentials.json')
})

Tests

To be able to run tests locally, put a .google-credentials.json file in this repository's root directory.

License

Apache-2.0

Current Tags

  • 1.1.0                                ...           latest (10 months ago)

2 Versions

  • 1.1.0                                ...           10 months ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |