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

@dimah-form/dataset

v0.6.0

Published

Official dataset plugin for dimah-form (JSONL + codebook interchange)

Readme

@dimah-form/dataset

Official dataset plugin. Project stored responses into a versioned JSON Lines + codebook interchange. CSV is a convenience encoding. HTTP stays paged; a full-file zip belongs in the consumer app.

Derived data only. The plugin does not add tables or a meta namespace. Records are built from the response definition snapshot, never the live questionnaire.

Install

pnpm add @dimah-form/dataset

Depends on @dimah-form/scoring. Peer-depends on @dimah-form/core. The server entry also needs @dimah-form/server. Browser modules should import from @dimah-form/dataset/client so the server package stays off the client bundle. Isomorphic code imports @dimah-form/scoring/document.

import { datasetPlugin } from "@dimah-form/dataset";
import {
  datasetClientPlugin,
  createDatasetReader,
  toJsonl,
} from "@dimah-form/dataset/client";

export const form = dimahForm({
  database,
  plugins: [
    datasetPlugin({
      onProject: async ({ record }) => {
        await warehouse.upsert(record.id, record);
      },
    }),
  ],
});

const clientPlugins = [datasetClientPlugin()] as const;
export const formClient = createFormClient<Form, typeof clientPlugins>({
  plugins: clientPlugins,
});

Guard operations for GET /dataset/responses, GET /dataset/codebook/history, and GET /dataset/codebook are getDatasetPage, getDatasetCodebook, and getLiveCodebook. Treat them like listResponses (admin).

getLiveCodebook is the live form. snapshots[0].n is 0; snapshots[0].key is the live instrument hash. Historical views come from getDatasetCodebook / createDatasetReader. Page codebooks are that page only. Newest lastSeenAt is canonical. An earlier snapshot whose field, score variable, band, or formula differs is one history entry (full view, keyed by snapshotKey). Walks are capped (default 10_000). Query maxRows can lower that cap, not raise it. The result includes truncated, and readCodebook() returns it.

onProject runs after submit. Upsert by record.id — reopen then submit runs it again.

Interchange

spec: "dimah.dataset/v1" on every JSON object. snapshotKey is SHA-256 of RFC 8785 canonical JSON. Canonical file is responses.jsonl plus codebook.json. toDataPackage() returns a Frictionless tabular data package (primaryKey, dialect, and codebook constraints on responses.csv only). attachment is set only for type: "file".

A field id that is an identity column (id, formId, status, submittedAt, createdAt, updatedAt, snapshotKey, respondentId) or starts with score. is written as field.<id>. If that name is also a field id, encoding throws. Score columns are score.<id>.raw, .band, .complete, and .missing (unanswered item count). Variable missing policy (zero / omit / incomplete) stays on the codebook; when the form omits it, scoring's default is incomplete.

License

MIT