Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@kotori-bot/i18n
Advanced tools
这是一个轻量级的国际化(i18n)工具库,可以方便地实现 JavaScript/TypeScript 项目的本地化支持。
它通过结合 ECMAScript 国际化API,可以快速为项目添加多语言翻译能力,使同一套代码支持多种语言,而不需要重新部署。开发者只需准备翻译文件,就可以轻松适配不同地区的用户。
use()
方法加载翻译文件locale()
获取已翻译的文案字符串lang
属性切换语言,扩展新实例添加语言import I18n from '@kotori-bot/i18n';
const i18n = new I18n();
i18n.use(translations, 'en');
i18n.locale('hello'); // 获取翻译文案
i18n.date(Date.now()); // 本地化格式化日期
i18n.number(10000); // 转换数字格式
i18n.setLang('zh'); // 切换语言
translations
可通过导入外部 JavaScript/TypeScript 文件获取,在 Node.js 环境中,将该参数替换成目录名,可自动读取指定目录下所有符合文件名与后缀名要求的数据(json/yaml 或者更多...)文件,并自动加载。
FAQs
i18n For Kotori
The npm package @kotori-bot/i18n receives a total of 7 weekly downloads. As such, @kotori-bot/i18n popularity was classified as not popular.
We found that @kotori-bot/i18n 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.