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

@morkg/lamed

v1.0.1

Published

@morkg/lamed is a lightweight, fluent, and highly scalable i18n (internationalization) library for TypeScript. The package allows you to define flat string paths (e.g., 'ui/button/save') and magically compiles them into a deeply nested, strictly-typed dic

Readme

Lamed

A bidirectional, strictly-typed i18n builder for TypeScript.

@morkg/lamed lets you define flat translation keys and compile them into a nested dictionary with native fallback locale support, preset collections, and function-based translations.

Why use Lamed

  • Fluent, chainable API for locale setup and dictionary compilation
  • Strict TypeScript types for generated nested translation objects
  • Zero runtime overhead from path nesting
  • Presets for common UI, auth, validation, http, navigation, date, field, and language strings
  • Support for function-based translations and fallback locale resolution

Installation

npm install @morkg/lamed

or

yarn add @morkg/lamed

Quick Start

import lamed from "@morkg/lamed";

const dict = lamed()
  .locate("en-US", "pt-BR")
  .define({
    "auth/signIn": {
      "en-US": "Sign in",
      "pt-BR": "Entrar",
    },
    "auth/greeting": {
      "en-US": (name: string) => `Hello, ${name}!`,
      "pt-BR": (name: string) => `Olá, ${name}!`,
    },
  })
  .dict();

console.log(dict.auth.signIn);
console.log(dict.auth.greeting("John"));

API

lamed()

Creates a new builder instance.

.locate(primary, fallback?)

Sets the active locale and optional fallback locale.

.define(...presetsOrDefinitions)

Registers translation definitions or preset collections.

.dict()

Compiles the nested dictionary for the current locale and fallback chain.

Presets

Lamed includes built-in preset packages that can be merged into your own definitions.

import lamed, { preset } from "@morkg/lamed";

const dict = lamed()
  .locate("en-US")
  .define(
    preset.ui,
    preset.auth,
    {
      "ui/actions/save": {
        "en-US": "Save Changes",
      },
      "app/custom/title": {
        "en-US": "My App",
      },
    }
  )
  .dict();

console.log(dict.ui.actions.save);
console.log(dict.auth.signIn);

Custom Presets

Create your own preset definitions with the same type-safe shape as built-in presets.

import type { Preset } from "@morkg/lamed";

export const myCustomPreset = {
  "admin/users/create": {
    "en-US": "Create User",
    "pt-BR": "Criar Usuário",
  },
} satisfies Preset;

How it works

Lamed stores translations as flat paths grouped by locale and builds a nested dictionary only when .dict() is called.

  • locate() chooses the active and fallback locale
  • define() accepts translation maps and preset objects
  • dict() resolves missing values from fallback locale and returns a typed nested object

Runtime behavior

  • Missing translations fall back to the fallback locale
  • Translation leaf values can be strings or typed functions
  • The final result mirrors the flat key structure as a nested tree

Exports

@morkg/lamed exports:

  • lamed — default factory function
  • preset — built-in preset namespace
  • ui, auth, validation, http, date, navigation, field, language — individual preset exports
  • Preset, StandardLocales, Locale — TypeScript helper types
import lamed, { auth, validation } from "@morkg/lamed";

const dict = lamed()
  .locate("en-US")
  .define(auth, validation)
  .dict();

Contributing

Contributions are welcome. Please open an issue or pull request at https://github.com/morkg/lamed.

  • Open an issue for major changes
  • Keep PRs small and descriptive
  • Run npm run build before submitting when relevant

License

MIT