Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@astronautlabs/datastore

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astronautlabs/datastore - npm Package Compare versions

Comparing version
3.1.0
to
3.1.2
+8
-3
package.json
{
"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"
}
{
"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"
]
}
# @/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');
```