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 🙏

© 2024 – Pkg Stats / Ryan Hefner

oni-i18njs

v0.0.2

Published

a tool in node for i18n

Downloads

3

Readme

i18n util

GetStart

  1. install
npm install oni-i18n --save-dev
  1. 添加下面的代码到 package.json 里面
"scripts": {
  "i18n": "i18n src/a.js"
}
  1. run
npm run i18n

Result

  1. 这里会在当前项目中生成一个 i18n.json 文件,记录了所有需要翻译的中文词条
  2. 已经替换了所有文件中需要国际化的地方,和一头部的代码相对应,替换后的代码如下, :
3. 词条文件 `i18n.json` 中内容如下:
```json
{ 
  "components_i18n_uSnL": "测试",
}

Description

  1. npm run i18n <path><path> 可以是当前项目中的任何目录, 最好是传文件,目录反应太慢了 , 只针对传入目录下的所有文件进行国际化。
  2. 由于使用了正则匹配, 该脚本全目录内最大限度做到去重中文词条,避免重复翻译,欢迎PR👏👏👏👏👏
  3. 我准备了相关的测试文件,您可以直接 npm run test 试试看。
  4. have fun; 这个项目来自:https://github.com/jianfenkezhan/i18njs 因为要求内部的包,都在可控的范围,所以项目组要求我再重新发一个包,