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

@dcsv-io/d2-i18n-abstractions

v0.1.2

Published

<!-- Copyright (c) DCSV. Licensed under the Apache License, Version 2.0. -->

Readme

@dcsv-io/d2-i18n-abstractions

Foundational, zero-dependency package that declares the i18n primitive types: the TKMessage translation-message shape, the tk() factory that constructs one, and the spec-derived TkMessageWireShape property-name catalog. Mirrors DcsvIo.D2.I18n.Abstractions on the .NET side — a leaf package with no outbound dependencies, so any package in the graph can import these primitives without risking a circular dependency.

Install

pnpm add @dcsv-io/d2-i18n-abstractions

Public API

| Export | Purpose | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | TKMessage | The translation-message shape — { key: string; params?: Record<string, unknown> }. Carried by D2Result.messages and rendered by a translator. | | tk | Factory constructing a TKMessage from a key plus optional params. Mirrors the .NET new TKMessage(key, params) ergonomics. | | TkMessageWireShape | Spec-derived JSON property-name catalog (KEY, PARAMS) for the TKMessage wire shape — referenced by serializers instead of inline literals. |

TkMessageWireShape is auto-generated from contracts/tk-message/tk-message.spec.json from the tk-message spec (sources committed). Do not edit src/generated/tk-message.g.ts by hand — changes will be overwritten on the next codegen run.

Dependencies

None. Zero runtime deps — this is a foundational leaf in the dependency graph.

Usage example

import { tk, type TKMessage } from "@dcsv-io/d2-i18n-abstractions";

const message: TKMessage = tk("common_errors_NOT_FOUND");
// message === { key: "common_errors_NOT_FOUND" }

const withParams = tk("common_errors_LIMIT_EXCEEDED", { maxLength: 256 });
// withParams === { key: "common_errors_LIMIT_EXCEEDED", params: { maxLength: 256 } }

Why a separate package

TKMessage is the shared currency of the result + i18n surfaces: @dcsv-io/d2-result carries TKMessage[] on every D2Result, @dcsv-io/d2-i18n-keys exposes the TK constants as TKMessage instances, and @dcsv-io/d2-i18n renders them. Placing the type and its factory in a zero-dependency leaf lets all three depend on it without forming a cycle, and keeps @dcsv-io/d2-result focused on the result envelope rather than owning an i18n primitive.

Parity with .NET

Mirrors DcsvIo.D2.I18n.Abstractions — both declare TKMessage plus the spec-derived wire-shape property names, generated from the same contracts/tk-message/tk-message.spec.json source. Single spec, two emitters, cross-language wire drift structurally impossible.