npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

hikoutei

v0.11.141-dev

Published

Typed repository and safe write layer for Google Sheets-backed MVPs. SQLite-authoritative entity lifecycle with asynchronous Google Sheets projection.

Readme

한국어 | 日本語

Hikoutei

Keep your app fast with SQLite. Keep your workflow visible in Google Sheets.

A typed repository and safe write layer for Google Sheets-backed MVPs: your application reads and writes local SQLite through typed entities, and committed changes are asynchronously projected to Google Sheets for human review and lightweight collaboration.

npm · Quick start · Issues

npm version license TypeScript

What is Hikoutei?

Hikoutei gives TypeScript applications a typed entity API backed by local SQLite, then asynchronously synchronizes committed changes to Google Sheets.

Your application does not wait on Google Sheets for normal reads and writes. Sheets remains available for inspection, operations, and lightweight human collaboration.

Hikoutei is not a raw Sheets API wrapper, not a replacement for PostgreSQL, and it does not treat Google Sheets as the authoritative application database. SQLite is the source of truth; Sheets is the human-facing view.

Why Hikoutei?

  • Define typed entities instead of manually converting Sheet rows.
  • Read and write through local SQLite without waiting for Google Sheets.
  • Synchronize committed changes to Sheets in the background.
  • Detect unexpected column changes and duplicate headers.
  • Avoid overwriting newer Sheet edits during conflicting updates.

Hikoutei does not replace google-spreadsheet or @googleapis/sheets — it sits one level above them. If you only need raw spreadsheet access, use the API client directly.

| Capability | Hikoutei | google-spreadsheet | @googleapis/sheets | | --- | :-: | :-: | :-: | | Typed entity model | ✅ | ❌ | ❌ | | Fast local application reads | ✅ | ❌ | ❌ | | Async projection to Sheets | ✅ | ❌ | ❌ | | Durable write retry and deduplication | ✅ | ❌ | ❌ | | Conflict-aware Sheet updates | ✅ | ❌ | ❌ | | Direct row and cell manipulation | Limited | ✅ | ✅ | | Full Google Sheets API access | Provider only | Partial | ✅ |

Installation

npm install hikoutei @mikro-orm/core @mikro-orm/sql

Installing the library does not touch Google Cloud — it runs local-only (SQLite) by default. Run the setup command below only when you want Sheet sync.

Setup (Google Sheets sync)

One-time, interactive. Install the gcloud CLI, then:

npx hikoutei setup

This creates the Cloud project, service account, key, and spreadsheet, and writes .env for you. Without HIKOUTEI_SYNC_SPREADSHEET_URL, createTypedSheets() stays local-only (SQLite). Details, credential pools, quota guidance, and manual setup: Google Sheets setup.

Usage

Define a scalar entity and use the local SQLite authority through a request-local manager.

import { createTypedSheets, defineTypedSheetsEntity } from "hikoutei";

const User = defineTypedSheetsEntity({
  name: "User",
  tableName: "users",
  properties: {
    id: { type: "string", primary: true },
    name: { type: "string" },
    age: { type: "number" },
    active: { type: "boolean" },
  },
});

const hikoutei = await createTypedSheets({
  dbName: "./hikoutei.sqlite",
  entities: [User],
});

const em = hikoutei.em.fork();
const user = em.create(User, { id: "u1", name: "Ada", age: 36, active: true });
em.persist(user);
await em.flush();

user.name = "Ada Lovelace";
await em.flush();

const loaded = await em.findOne(User, { id: "u1" });
if (loaded !== null) {
  em.remove(loaded);
  await em.flush();
}

More reads, transactions, and operators: Quick start.

Writes commit to local SQLite immediately — the request never waits on Google. Human edits in the Sheet flow back through polling — accepted into SQLite or recorded as conflicts, never silently overwritten. The full pipeline (outbox, delivery, conflict handling) is covered in Write and synchronization flow.

Learn more

License

Hikoutei is released under the MIT License.