# fetch-firestore-types

> Firestore types file maker

Latest version **1.1.0** (published 2024-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install fetch-firestore-types
pnpm add fetch-firestore-types
yarn add fetch-firestore-types
bun add fetch-firestore-types
```

Provides the command `fetch-firestore-types`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2024-03-03 |
| First published | 2023-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Etienne Moureton |
| Maintainers | etiennemoureton |
| Keywords | typescript, npm, template, ts |

## Links

- npm: https://www.npmjs.com/package/fetch-firestore-types
- Repository: https://github.com/YsarocK/fetch-firestore-types
- Homepage: https://github.com/YsarocK/fetch-firestore-types#readme
- Issues: https://github.com/YsarocK/fetch-firestore-types/issues
- npm.io page: https://npm.io/package/fetch-firestore-types

## Dependencies (4)

- [dotenv](https://npm.io/package/dotenv.md) ^16.0.3
- [dts-dom](https://npm.io/package/dts-dom.md) ^3.7.0
- [ts-node](https://npm.io/package/ts-node.md) ^10.9.1
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^11.5.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2024-03-03
- 1.0.1 — 2024-03-03
- 1.0.0 — 2023-04-04
- 0.3.0 — 2023-04-04
- 0.2.0 — 2023-04-04

## README

![fetch-firestore-types banner](./readme-banner.jpg)

# Generate Typesript types from Appwrite Databases

![npm](https://img.shields.io/npm/dt/fetch-appwrite-types)
![npm](https://img.shields.io/npm/v/fetch-appwrite-types)

## Quick usage
Make sure ton add the following values to your ```.env``` :
```FIREBASE_PROJECT_ID```
```FIREBASE_PRIVATE_KEY```
```FIREBASE_CLIENT_EMAIL```

Then run the following command :

```bash
npx fetch-firestore-types
```

## Installation
```bash
# yarn
yarn add fetch-firestore-types

# npm
npm install fetch-firestore-types
```

Make sure ton add the following values to your ```.env``` :
```FIREBASE_PROJECT_ID```
```FIREBASE_PRIVATE_KEY```
```FIREBASE_CLIENT_EMAIL```

```javascript
import { FetchNewTypes } from "fetch-firestore-types/dist/main";

await FetchNewTypes();
```

## Parameters
| Name     | Default value  | Description                                        |
|----------|----------------|----------------------------------------------------|
| outDir   | ```"/types"``` | The folder where the type file will be generated   |
| queryResultsLength | ```25```        | Number of items per collection to creates types on |

### Usage
#### CLI
Params can be passed as arguments in any order, except for the outDir which might be followed by the path.
```bash
npx fetch-appwrite-types includeDBName outDir /types queryResultsLength 50
```

#### Library
```javascript
await FetchNewTypes({
    outDir: "/types",
    queryResultsLength: 50,
})
```

## Handled types
| Appwrite type    | Generated type (simple) |
|------------------|-------------------------|
| String           | ```string```            |
| Integer / Double | ```integer```           |
| Boolean          | ```boolean```           |
| Null             | ```null```              |
| Array            | ```Array<any>```        |
| Object           | ```Object```            |

---
_Source: https://npm.io/package/fetch-firestore-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
