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

@live-i18n/plugin

v0.0.2

Published

Node-side Angular dev-server builder for the Live i18n Editor. Wraps @angular/build:dev-server and mounts a save API that safely rewrites translation JSON on disk (formatting preserved). Pairs with @live-i18n/client.

Readme

@live-i18n/plugin

Node-side dev-time backend for the Live i18n Editor. It ships a custom Angular dev-server builder that wraps @angular/build:dev-server and mounts a small save API. When the in-browser inspector (@live-i18n/client) posts an edit, the matching key in your translation JSON is rewritten on disk — indentation and trailing newline preserved.

Why a builder, not a Vite plugin? Angular's dev server runs Vite in-memory; there is no vite.config.* to register a plugin in, and AOT component templates never pass through Vite's .html transform. The supported seam is the public executeDevServerBuilder(options, context, extensions), which this package wraps to inject the save middleware.

Setup

1. Install both packages as dev dependencies:

npm install --save-dev @live-i18n/client @live-i18n/plugin

2. Point your app's serve target at the builder.

In an Nx workspace, edit the app's project.json (the field is executor):

"serve": {
  "executor": "@live-i18n/plugin:dev-server",
  "continuous": true,
  "options": {
    // Workspace-relative folder holding your <lang>.json files.
    "translationsPath": "apps/playground/src/assets/i18n",
    // Optional: extra roots scanned for feature-split <lang>.json files.
    "searchRoots": [
      "apps/playground/src/assets/i18n",
      "apps/playground/src/app/features"
    ]
    // "endpoint": "/__live-i18n-update"  // optional override
  },
  "configurations": {
    "development": { "buildTarget": "playground:build:development" },
    "production": { "buildTarget": "playground:build:production" }
  },
  "defaultConfiguration": "development"
}

In a plain Angular CLI workspace, edit angular.json instead — the field is builder (not executor), and there's no continuous/dependsOn:

"serve": {
  "builder": "@live-i18n/plugin:dev-server",
  "options": {
    "buildTarget": "my-app:build",
    "translationsPath": "src/assets/i18n",
    "searchRoots": ["src/assets/i18n", "src/app/features"]
  },
  "configurations": {
    "development": { "buildTarget": "my-app:build:development" },
    "production": { "buildTarget": "my-app:build:production" }
  },
  "defaultConfiguration": "development"
}

npx nx serve playground (or ng serve) now serves as usual and additionally listens for POST /__live-i18n-update.

How it pairs with @live-i18n/client

The client auto-tags translated elements with data-i18n-key — primarily via invisible key markers emitted by the translate pipe (recovering the exact key), with reverse-lookup against the loaded dictionary as a fallback — then posts { key, value, lang } to the endpoint. This builder validates the request and rewrites the matching <lang>.json, routing across searchRoots for feature-split folders. See @live-i18n/client's provideLiveTranslations(...) (and its withNgxTranslate / withTransloco adapters) for wiring the locale/dictionary on the browser side.

Save endpoint

POST <endpoint> — body { key: string, value: string, lang: string }

| Status | Meaning | | ------ | --------------------------------------------------------- | | 200 | { ok: true, key, lang } — file updated | | 400 | invalid JSON / missing fields / unsafe locale or key | | 404 | <lang>.json not found in translationsPath | | 500 | read / parse / write failure |

Guards: the locale must match ^[a-zA-Z][a-zA-Z0-9_-]*$, the resolved path must stay inside translationsPath, and key segments __proto__ / prototype / constructor are rejected (prototype-pollution).

Programmatic API

import { updateTranslationFile, createSaveMiddleware } from '@live-i18n/plugin';
  • updateTranslationFile(basePath, lang, key, value) — the safe JSON writer.
  • createSaveMiddleware({ translationsPath, endpoint }) — the Connect middleware, if you want to mount it yourself.

Building / testing

npx nx build dev-plugin