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

@softwarity/polyglot

v1.0.0

Published

Serve every locale of an Angular i18n app at once behind a single dev port. Reads angular.json, spawns one ng serve per locale, proxies each under its subPath.

Downloads

141

Readme

@softwarity/polyglot

npm version license Angular Node CI

Serve every locale of an Angular i18n app at once, behind a single dev port.

ng serve runs one locale at a time, so you never see the real multi-locale URL shape in development. polyglot reads your angular.json, spawns one ng serve per locale on a private port, and puts a single proxy in front — so /en/, /fr/, /vi/… all work from one URL, exactly like the deployed site.

📖 Documentation: https://softwarity.github.io/polyglot/

Install

npm i -D @softwarity/polyglot

Quick start

# 1. Add a ready-to-run script to package.json (writes "start:i18n")
npx polyglot init

# 2. Run it — pick which locales to start
npm run start:i18n

init writes the defaults so you can see and tweak them:

"scripts": {
  "start:i18n": "polyglot --config=./angular.json --port=4200"
}

At launch, polyglot reads your locales and asks which to run (nothing is saved):

Project: my-app — source locale: en — baseHref: /

Available locales:
  1. en  (source)
  2. fr
  3. vi

Which locales to run? Comma-separated numbers (e.g. "1,3"), "all" (default), or "q" to quit: all

▸ Proxy listening on 0.0.0.0:4200 — open one of:
    Local:   http://localhost:4200/
    en       → http://localhost:4200/en/  (ng serve :49b1)
    fr       → http://localhost:4200/fr/  (ng serve :49b2)
    vi       → http://localhost:4200/vi/  (ng serve :49b3)
▸ Fallback locale: en

Commands & options

polyglot [options]         # Start the multi-locale dev proxy (default)
polyglot init [options]    # Add a "start:i18n" script to package.json
polyglot --help            # Show usage

| Option | Default | Description | | --- | --- | --- | | --config=<path> | ./angular.json | Angular workspace config to read locales from | | --project=<name> | first project | Project to serve (multi-project workspaces) | | --port=<number> | 4200 (or $PROXY_PORT) | Public port for the proxy | | --help | — | Print usage and exit |

There is intentionally no --prebundle flag and no locale flag: locales are chosen interactively, and Vite prebundling is derived from your selection (off for multiple locales, on for one — see below).

How it works

  • Reads i18n, baseHref and serve configs from angular.json.
  • Picks a free private port per locale and spawns ng serve --configuration=<locale> bound to 127.0.0.1.
  • Runs one Express proxy on the public port, routing each locale's subPath (<baseHref><subPath>) to its ng serve instance; any other path redirects to the source locale.
  • Tears everything down on exit (SIGTERMSIGKILL) — no orphan servers.

Prebundling. Angular's dev-server runs on Vite, which pre-bundles dependencies into a shared .angular/cache directory. With several ng serve running at once, each optimizer keeps invalidating the others ("There is a new version of the pre-bundle…"), wedging SSR in a re-optimize loop. So polyglot disables prebundling automatically when more than one locale runs, and keeps it on for a single locale.

Requirements

A standard Angular i18n setup in angular.json:

  • an i18n block with sourceLocale and locales (each may declare a subPath);
  • a build configuration per locale with a matching baseHref ("/<subPath>/");
  • a serve configuration per locale (ng serve --configuration=<code>).

See the Angular setup guide.

License

MIT © Softwarity