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

fasti18n

v0.0.1-alpha27

Published

a nodejs cli tool that transforms chinese characters automaticly

Downloads

3

Readme

fast i18n

A nodejs cli tool that transforms chinese characters automaticly, based on sweet-i18n/sugar18 [Docs]. Many thanks to the original author!

Compared with the original plugin, support for Vue2 Class Component and TypeScript has been added. Optimized extraction support for concatenated strings (eg: num + 'days') and Vue interpolation templates (eg: {{ num }} + 'days'), exporting tsv files, specifying extraction ranges, etc. The plugin is still under development and there may be some bugs.

Install

npm i -g fasti18n

Usage

默认已设置为错误的命令提供帮助(Default is set to help with incorrect commands)

Usage: fasti18n [options]

Options:
  -V, --version                 output the version number
  -i --import <importPath>      [必需]导入的I18N对象路径,eg: '@/lib/i18n',会自动生成 'import I18N from @/lib/i18n'([required] the imported I18N object path, eg: '@/lib/i18n', will automatically generate 'import I18N from @/lib/i18n')
  -s --scope <scope>            限制查找的范围,默认查找项目下全部文件(Limit the search scope, and search all files under the project by default)
  -p --output <output>          输出路径,默认'i18n/zh-CN.json'(Output path, default 'i18n/zh-CN.json')
  -ig --ignore <ignoreList...>  指定的路径查找时会被跳过,多个路径使用空格隔开(The specified path will be skipped when searching, and multiple paths are separated by spaces)
  -e --entry <entryFile>        通过入口文件的依赖查找(Dependency lookup through entry files)
  --alias <aliasList...>        [--entry指定时]import中使用的别名列表,如@:src标识用@代替src路径(['--entry' required]Alias list used in import, such as '@:src' uses '@' instead of 'src' path)
  --tsv                         额外输出tsv文件(Extra output TSV file)
  -h, --help                    display help for command

Example

按文件列表遍历获取中文

fasti18n -i @/lib/i18n --tsv

效果如下:

  • 设置import代码为import I18N from @/lib/i18n
  • 完全遍历
  • 额外输出TSV文件用于其他软件读取

-s, -p, -ig为其余可选项,详见Usage一栏

按入口文件遍历获取中文

fasti18n -i @/lib/i18n -e path/to/your/entry/file.vue --alias @:src --tsv

效果如下:

  • 设置import代码为import I18N from @/lib/i18n
  • 设置入口文件为path/to/your/entry/file.vue
  • 设置alias别名,将@自动转成src
  • 额外输出TSV文件用于其他软件读取