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

@i18nez/core

v1.3.0

Published

Framework-agnostic client for the i18nez translation API

Readme

@i18nez/core

Framework-agnostic TypeScript client for the i18nez translation API.

Use this package directly if you're building for a framework without a dedicated i18nez SDK (Vue, Svelte, Solid, plain TS). React developers should reach for @i18nez/react instead.

npm install @i18nez/core

Quickstart

import {
  createClient,
  TranslationCache,
  TranslationQueue,
  hashText,
} from "@i18nez/core";

const client = createClient({
  apiKey: "tlv_pub_...",
  defaultLocale: "en",
});

// One-shot translation
const { text } = await client.translate(
  "Welcome to our app",
  "en",
  "it",
);

// Batch (optional `dynamic` flag: translate + Redis cache only,
// no persistence to the locale bundle, perfect for product names,
// user-generated content, etc.)
const [ciao] = await client.translateBatch(
  ["Hello world"],
  "en",
  "it",
  /* context */ undefined,
  /* dynamic */ true,
);

// Bulk-fetch a locale bundle
const bundle = await client.getBundle("it");

// Batched, de-duplicated queue
const cache = new TranslationCache();
const queue = new TranslationQueue(client, cache, {
  sourceLocale: "en",
  batchInterval: 50,
  batchSize: 10,
});
const hash = await hashText("Hello world");
await queue.enqueue("Hello world", hash, "it", /* context */ undefined, /* dynamic */ false);

Exports

| Export | Purpose | |---|---| | createClient(config) | HTTP client with retry, rate-limit handling, error classes | | TranslationCache | In-memory LRU cache with optional persistence adapter | | TranslationQueue | Batches and de-duplicates concurrent translate calls | | hashText(s) | SHA-256 content hash (matches backend) | | detectLocale() | Browser + Node locale detection | | isValidLocale / normalizeLocale | BCP-47 validation | | QuotaExceededError, RateLimitedError, InvalidApiKeyError | Typed error classes |

Persistence

Provide any adapter matching the PersistenceAdapter interface, localStorage, AsyncStorage, IndexedDB, SQLite:

const adapter: PersistenceAdapter = {
  async get(key) { return localStorage.getItem(key); },
  async set(key, value) { localStorage.setItem(key, value); },
  async remove(key) { localStorage.removeItem(key); },
};

License

MIT