@firestore-emulator/server

中文文档
0.3.15发布于 2026/01/01MITTypeScriptESM + CJS近 30 天下载 4569

This package is the implementation of the Firestore emulator. It is a Node.js

原始使用文档
文档目录6 节
  1. Installation
  2. Usage
  3. API
  4. FirestoreServer
  5. FirestoreState
  6. toJSON()

@firestore-emulator/server

This package is the implementation of the Firestore emulator. It is a Node.js

Installation

npm install @firestore-emulator/server

Usage

import { FirestoreServer } from '@firestore-emulator/server'

const server = new FirestoreServer()
await server.start(8080)
// now you can connect to the emulator at localhost:8080

API

FirestoreServer

state

The current state of the emulator.

see below: FirestoreState

FirestoreState

toJSON()

emits a JSON representation of the state.

for example, you can use the firestore data for snapshot testing:

expect(server.state.toJSON()).toMatchSnapshot()

版本与发布记录

@firestore-emulator/server 共发布 55 个版本,首次发布于 2023/08/13;过去 12 个月发布了 10 个版本。

版本发布日期距今
0.3.15latest2026/01/0110 个月前
0.3.142025/12/2210 个月前
0.3.132025/12/1510 个月前
0.3.122025/12/0811 个月前
0.3.112025/12/0111 个月前
0.3.102025/11/2411 个月前

关于 @firestore-emulator/server 的常见问题

@firestore-emulator/server 是什么?

This package is the implementation of the Firestore emulator. It is a Node.js

如何安装 @firestore-emulator/server?

在项目目录运行 npm install @firestore-emulator/server,或使用 pnpm add / yarn add / bun add。

@firestore-emulator/server 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@firestore-emulator/server 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@firestore-emulator/server 可以商用吗?

@firestore-emulator/server 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@firestore-emulator/server 的下载量有多少?

根据 npm 官方下载统计,@firestore-emulator/server 在 2026/10/15 – 2026/11/13 这 30 天内被下载 4,569 次,日均约 152 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@firestore-emulator/server 还在维护吗?

最新版本 0.3.15 发布于 2026/01/01(10 个月前);至今共发布 55 个版本,其中过去 12 个月发布了 10 个;首次发布于 2023/08/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。