
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
一个易用、低侵入的多语言翻译工具,适合中大型前端项目的国际化需求。
pnpm add easy-lang
# 或
npm install easy-lang
# 或
yarn add easy-lang
// translation.json
{
"错误": {
"zh_CN": "错误",
"zh_HK": "錯誤",
"en": "Error"
},
"保存": {
"zh_CN": "保存",
"zh_HK": "保存",
"en": "Save"
}
}
import { createI18nTool } from "easy-lang";
import translations from "./translation.json";
const i18n = createI18nTool<typeof translations, "zh_CN" | "zh_HK" | "en">({
defaultLang: "en",
langs: ["zh_CN", "zh_HK", "en"],
translations,
});
// 获取翻译
i18n.$t("错误"); // => "Error"
// 切换语言
i18n.changeLang("zh_CN");
支持在翻译文本中使用 {变量名},如:
{
"欢迎": {
"en": "Welcome, {name}!"
}
}
调用:
i18n.$t("欢迎", { name: "Tom" }); // => "Welcome, Tom!"
未翻译的 key 会自动收集到 untranslatedList,便于后续补全。
本项目使用 vitest 进行单元测试。
pnpm test
pnpm build
MIT
FAQs
An easy-to-use, low-intrusion translation tool
The npm package easy-lang receives a total of 7 weekly downloads. As such, easy-lang popularity was classified as not popular.
We found that easy-lang demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.