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

datasette-ts

v0.0.22

Published

TypeScript-first Datasette-style explorer for SQLite, with local serve and Cloudflare Workers deploy.

Downloads

2,802

Readme

datasette-ts

TypeScript-first Datasette-style explorer for SQLite, with local serve and Cloudflare Workers deploy.

Install

npm install -g datasette-ts
# or
npx datasette-ts --help

Quickstart (local)

datasette-ts serve ./my.db --port 8001

Open http://127.0.0.1:8001.

Inspect a database

datasette-ts inspect ./my.db --inspect-file inspect-data.json

Deploy to Cloudflare

First, set up Alchemy (docs):

npx alchemy configure
npx alchemy login

Then deploy:

# Deploy with name derived from filename
datasette-ts deploy cloudflare ./my.db

# Deploy with explicit name
datasette-ts deploy cloudflare ./my.db --name my-app

# Deploy with a specific Alchemy profile
datasette-ts deploy cloudflare ./my.db --name my-app --profile prod

# Deploy with metadata (robots settings, cache settings, etc.)
datasette-ts deploy cloudflare ./my.db --metadata datasette.yml

This creates a Cloudflare Worker and D1 database with your data.

CLI help

datasette-ts --help
datasette-ts serve --help
datasette-ts inspect --help
datasette-ts deploy cloudflare --help

HTTP caching

Defaults to Cache-Control: max-age=5 on all responses. You can override this default using a setting, or per-request using the _ttl query string parameter:

# Set the default max-age for all responses (in seconds)
datasette-ts serve ./my.db --setting default_cache_ttl 60

# Override cache behavior for a single request
curl "http://127.0.0.1:8001/?_ttl=0"
curl "http://127.0.0.1:8001/?_ttl=120"

You can also set default_cache_ttl via metadata:

settings:
  default_cache_ttl: 60
  • default_cache_ttl of 0 disables caching by sending Cache-Control: no-store.
  • _ttl=0 disables caching for that request; _ttl=<seconds> sets max-age.

Hashed URLs

Hashed URLs include a content hash in the database path (e.g. /mydb-abc1234/table), enabling long-lived immutable caching. When enabled, responses include Cache-Control: public, max-age=31536000, immutable.

Enable via metadata:

settings:
  hash_urls: true

Or per-request with ?_hash=1. Cloudflare Workers enable hashed URLs by default (set DATASETTE_HASH_URLS=0 to disable).

Robots.txt

Serve a robots.txt that blocks crawlers by default. Configure it via metadata:

{
	"plugins": {
		"datasette-block-robots": {
			"allow_only_index": true
		}
	}
}

Options:

  • allow_only_index: allow indexing the homepage while blocking each database path.
  • disallow: custom list of paths to disallow, e.g. ["/mydb/mytable"].
  • literal: full robots.txt contents (overrides all other settings).

The /robots.txt endpoint returns the generated file with text/plain content.

Build

npm run build

Build outputs:

  • dist/cli.js (Node CLI entrypoint)
  • dist/worker.js (Cloudflare Worker entrypoint)

The deploy command prefers dist/worker.js when present, so the published package ships a ready-to-bundle worker.

Publish

npm version <patch|minor|major>
npm run build
npm pack
npm publish

Status

  • Works: local serve, inspect data export, Cloudflare Workers deploy via Alchemy.
  • Not yet: config files, plugins, write APIs.