{"id":19522166,"url":"https://github.com/captaincodeman/firestore-json","last_synced_at":"2026-06-15T19:31:00.839Z","repository":{"id":57236809,"uuid":"330810732","full_name":"CaptainCodeman/firestore-json","owner":"CaptainCodeman","description":"Firestore to JSON Converter","archived":false,"fork":false,"pushed_at":"2021-01-27T15:28:21.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T19:36:44.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CaptainCodeman.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-18T23:24:44.000Z","updated_at":"2021-02-18T08:48:51.000Z","dependencies_parsed_at":"2022-08-23T16:20:16.176Z","dependency_job_id":null,"html_url":"https://github.com/CaptainCodeman/firestore-json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Ffirestore-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Ffirestore-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Ffirestore-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Ffirestore-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CaptainCodeman","download_url":"https://codeload.github.com/CaptainCodeman/firestore-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240771906,"owners_count":19854982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T00:37:29.560Z","updated_at":"2025-11-18T19:03:34.179Z","avatar_url":"https://github.com/CaptainCodeman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firestore-JSON\n\nConvert Firestore REST response into simple JSON\n\n![typescript](https://badgen.net/badge/icon/typescript?icon=typescript\u0026label)\n![types included](https://badgen.net/npm/types/tslib)\n![normal size](https://img.shields.io/bundlephobia/min/firestore-json?style=flat-square)\n![gzipped size](https://img.shields.io/bundlephobia/minzip/firestore-json?style=flat-square)\n\nAdapted from [firestore-parser](https://www.npmjs.com/package/firestore-parser) to reduce size, improve performance, add options to decode timestamps to dates and base64 strings to bytes, and fix some errors.\n\n## Installation\n\nInstall using your package manager of choice:\n\n  pnpm i firestore-json\n\n## Example\n\n```ts\nimport { toJSON } from 'firestore-json'\n\nconst url = `https://firestore.googleapis.com/v1/projects/my-project/databases/(default)/documents/mycollection/my-doc`\n\nconst resp = await fetch(url)\nconst json = await resp.json()\nconst data = toJSON(json.fields)\n```\n\n## Options\n\nBy default, `timestampValue` and `bytesValue` fields are left as-is (ISO and Base64 strings respectively) but these can be converted to Javascript `Date` and `Uint8Array` types automatically by passing an options object to the `toJSON` method with `timestamps` and / or `bytes` set to true as required:\n\n```ts\nconst data = toJSON(json.fields, { timestamps: true, bytes: true })\n```\n\n## Data Structure\n\nThe Firestore JSON returned in the REST API, uses value type as keys. This can be difficult to work with since you have to know the data type prior getting the value. The firestore-parser removes this barrier for you.\n\n### JSON Response from Firestore\n\n```json\n{\n  \"player\": {\n    \"mapValue\": {\n      \"fields\": {\n        \"name\": {\n          \"stringValue\": \"steve\"\n        },\n        \"health\": {\n          \"integerValue\": \"100\"\n        },\n        \"alive\": {\n          \"booleanValue\": true\n        }\n      }\n    }\n  },\n  \"level\": {\n    \"integerValue\": \"7\"\n  }\n}\n```\n\n### JSON from firestore-json toJSON\n\n```json\n{\n  \"player\": {\n   \"name\": \"steve\",\n   \"health\": 100,\n   \"alive\": true\n  },\n  \"level\": 7\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptaincodeman%2Ffirestore-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaptaincodeman%2Ffirestore-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptaincodeman%2Ffirestore-json/lists"}