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

localize-core-cli

v1.0.0

Published

Production-grade deterministic localization + CloudFront migration platform. No AI required. Works fully offline.

Readme

localize-core-cli

Production-grade deterministic localization + CloudFront CDN migration platform. No AI required. Works fully offline. Zero LLM dependencies.

npm version License: MIT Node.js


What is this?

localize-core-cli is an enterprise-grade CLI + npm package that automates:

  • Localization — scan, extract, transform, and validate i18n strings across React, Angular, Vue, Next.js, and legacy codebases
  • CDN migration — detect legacy CDN URLs, upload assets to S3, generate CloudFront URLs, and replace all references in source code

All operations are fully deterministic and 100% offline — no OpenAI, Claude, Gemini, or any cloud AI is used or required.


Install

npm install -g localize-core-cli
# or
npx localize-core-cli <command>

Quick Start

# 1. Initialize config in your project root
npx ai-localize init

# 2. Scan for hardcoded UI text
npx ai-localize scan

# 3. Extract and generate locale JSON files
npx ai-localize extract

# 4. Validate locale files (missing keys, duplicates, placeholders)
npx ai-localize validate

# 5. Generate HTML + JSON report
npx ai-localize report

# 6. Run full pipeline (scan → extract → codemod → report)
npx ai-localize full-migrate

# Dry-run preview without writing files
npx ai-localize full-migrate --dry-run

Config

Running ai-localize init creates ai-localize.config.json in your project root:

{
  "framework": "react",
  "srcDir": "src",
  "defaultLanguage": "en",
  "targetLanguages": ["fr", "de"],
  "localesDir": "src/i18n/locales",
  "aws": {
    "bucket": "my-s3-bucket",
    "distributionId": "E1234ABCDEF",
    "region": "us-east-1"
  }
}

Programmatic API

const {
  Scanner,
  Validator,
  Reporter,
  LocaleEngine,
  CodemodEngine,
  FrameworkDetector,
  loadConfig,
} = require('localize-core-cli');

// Scan for hardcoded strings
const scanner = new Scanner({
  rootDir: './src',
  extensions: ['.tsx', '.ts', '.jsx', '.js'],
  excludeDirs: ['node_modules', 'dist'],
});
const { detectedTexts, filesScanned } = await scanner.scan();

// Generate locale files
const le = new LocaleEngine('./', {
  defaultLanguage: 'en',
  targetLanguages: ['fr', 'de'],
  localesDir: './src/i18n/locales',
});
const keyMap = le.generateFromDetectedTexts(detectedTexts, 'en', 'common');
le.syncLanguages('common');
le.persistAll();

// Validate
const validator = new Validator({
  baseLanguage: 'en',
  targetLanguages: ['fr', 'de'],
  locales: { en: keyMap },
  sourceTexts: detectedTexts,
});
const { missingKeys, duplicateKeys } = validator.validate();

// Report
const reporter = new Reporter();
reporter.generateCLI({ filesScanned, hardcodedTexts: detectedTexts.length });

// Codemods — inject useTranslation + t() wrappers
const ce = new CodemodEngine({ framework: 'react' });
const codeKeyMap = ce.buildKeyMap(detectedTexts);
const { code, modified } = ce.transformFile(sourceCode, codeKeyMap);

Supported Frameworks

| Framework | Detection | Scanning | Codemod | |-----------|-----------|----------|---------| | React (CRA, Vite, Next.js) | ✅ | ✅ | ✅ | | Angular (ngx-translate, Angular i18n) | ✅ | ✅ | ✅ | | Vue (vue-i18n) | ✅ | ✅ | ✅ | | Legacy (jQuery, Vanilla JS, JSP) | ✅ | ✅ | — |


Detected Text Types

  • JSX text nodes
  • String literals in JS/TS
  • HTML placeholder, title, aria-label attributes
  • Modal / Toast / Alert messages
  • Tooltip content
  • Table headers
  • Button labels
  • Form validation messages
  • Heading content

CLI Commands

| Command | Description | |---------|-------------| | ai-localize init | Initialize ai-localize.config.json | | ai-localize scan | Scan source files for hardcoded text | | ai-localize extract | Generate locale JSON files | | ai-localize validate | Validate locale completeness | | ai-localize report | Generate JSON + HTML reports | | ai-localize full-migrate | Full pipeline: scan → extract → codemod → report | | ai-localize full-migrate --dry-run | Preview without writing files |


AWS CloudFront CDN Migration

Configure your AWS credentials in environment variables or ~/.aws/credentials, then:

ai-localize upload-assets    # Hash and upload assets to S3
ai-localize replace-cdn      # Replace legacy CDN URLs with CloudFront URLs
ai-localize migrate-cdn      # Full CDN migration pipeline

Detects and replaces:

  • Hardcoded CDN URLs in source files
  • CSS background-image references
  • <img src> attributes
  • Environment variable CDN configs
  • Webpack / Vite public path configs

Locale Key Generation

Keys are generated deterministically from file path + component name + text:

src/pages/campaign/CreateCampaign.tsx
  "Save Campaign"
→ campaign.create.save_campaign

Features

  • ✅ Zero AI / LLM — fully deterministic
  • ✅ Works offline
  • ✅ AST-based scanning (Babel parser)
  • ✅ Format-preserving codemods (recast)
  • ✅ Incremental scanning (git diff / staged files)
  • ✅ Worker thread parallelism
  • ✅ Plugin system
  • ✅ Monorepo support
  • ✅ CI/CD ready (GitHub Actions, GitLab CI, Bitbucket Pipelines)
  • ✅ VS Code extension included

License

MIT © smaeeraabdul