@astronautlabs/datastore
Advanced tools
+8
-3
| { | ||
| "name": "@astronautlabs/datastore", | ||
| "version": "3.1.0", | ||
| "version": "3.1.2", | ||
| "description": "Isomorphic, abstracted, Firestore-compatible NoSQL data storage library", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "private": false, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsc -p .", | ||
| "build": "tsc -b .", | ||
| "prepublishOnly": "npm run build" | ||
@@ -21,3 +25,4 @@ }, | ||
| "rxjs": "^6.5.5" | ||
| } | ||
| }, | ||
| "gitHead": "4681136e899edacda36363f2edae6fc6a41107ac" | ||
| } |
+4
-31
| { | ||
| "extends": "../../tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "./dist", | ||
| "declaration": true, | ||
| "declarationDir": "./dist", | ||
| "module": "commonjs", | ||
| "moduleResolution": "node", | ||
| "experimentalDecorators": true, | ||
| "emitDecoratorMetadata": true, | ||
| "sourceMap": true, | ||
| "target": "es2017", | ||
| "lib": [ | ||
| "es2016", | ||
| "dom" | ||
| ] | ||
| "outDir": "./dist" | ||
| }, | ||
| "include": [ | ||
| "./src/**/*.ts", | ||
| "./test/**/*.ts", | ||
| "./*.ts" | ||
| ], | ||
| "typedocOptions": { | ||
| "mode": "file", | ||
| "theme": "markdown", | ||
| "out": "docs", | ||
| "target": "ES5", | ||
| "excludeExternals": true, | ||
| "excludePrivate": true, | ||
| "externalPattern": "**/node_modules/**", | ||
| "exclude": "**/node_modules/**,**/dist*/**,**/example/**,**/*.test.ts", | ||
| "categoryOrder": [ | ||
| "Entrypoint", | ||
| "*" | ||
| ] | ||
| } | ||
| "./src/**/*.ts" | ||
| ] | ||
| } |
-49
| # @/datastore | ||
| Isomorphic, abstracted, Firestore-compatible NoSQL data storage library. Use this as a better interface for Firestore. | ||
| ## Features | ||
| **Isomorphic** | ||
| This library can be used to interface with Firestore in the same way, whether your code is running in the browser or on Node.js. | ||
| **Better debugging of `permission-denied` errors** | ||
| `@/datastore` will capture `permission-denied` errors from Firebase and append useful information, such as what operation was attempted that caused the `permission-denied` error. This is the number one source of frustration when working with Firestore. | ||
| ## Usage (Firebase) | ||
| Install the Firebase Datastore implementation: | ||
| ``` | ||
| npm install @astronautlabs/datastore-firestore | ||
| ``` | ||
| First, initialize your app as normal using the `firebase` package (in the browser), | ||
| or the `firebase-admin` package (Node.js): | ||
| ```typescript | ||
| import * as firebase from 'firebase'; // or firebase-admin for Node.js | ||
| await firebase.initializeApp({ | ||
| apiKey: "...", | ||
| authDomain: "example.firebaseapp.com", | ||
| databaseURL: "https://example.firebaseio.com", | ||
| projectId: "example", | ||
| storageBucket: "example.appspot.com", | ||
| messagingSenderId: "..." | ||
| }); | ||
| ``` | ||
| Then use `createDatastore()` to create your Datastore instance: | ||
| ```typescript | ||
| import { createDatastore } from '@astronautlabs/datastore-firestore'; | ||
| let datastore = createDatastore(); | ||
| let doc = await datastore.read('/path/to/document'); | ||
| ``` | ||
| You can also specify the Firebase app you wish to use: | ||
| ```typescript | ||
| let datastore = createDatastore(appName: 'aSpecificAppName'); | ||
| ``` |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
6546
-25.15%10
-9.09%119
-18.49%2
100%0
-100%