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

naruto-cli

v1.1.7

Published

> 注意:执行路径不应出现中文、空格、特殊符号

Downloads

10

Readme

naruto-cli

注意:执行路径不应出现中文、空格、特殊符号

从源码安装

# 安装依赖
npm install
# 全局安装cli
npm run build

直接使用npm发布版

npm install -g naruto-cli

excel2json <excelDirPath> <outDirPath>

多语言 Excel 转 json 文件

参数说明

  • <excelDirPath>
    • 多语言 Excel 所在目录
  • <outDirPath>
    • 多语言 Excel 经过转换过输出 JSON 文件的指定目录
    • 即便指定输出目录,jsonForXml 会固定生成在 output/jsonForXml 下

Excel 示例文件

excel/lang/language.xlsx

注意:Excel 中红色部分不可修改

使用示例

# 在项目根目录下执行
naruto-cli excel2json ./excel/lang ./output/json

json2xml <jsonForXmlDirPath> <outDirPath>

将 excel2json 生成的多语言 json 文件 转 xml 文件

参数说明

  • <jsonForXmlDirPath>
    • 多语言 json 所在目录
      • 注意目录选择 jsonForXml 不是 json
      • jsonForXml 会固定生成在项目根目录下的 output/jsonForXml 下
  • <outDirPath>
    • 多语言 Excel 经过转换过输出 JSON 文件的指定目录

使用示例

# 在项目根目录下执行
naruto-cli json2xml ./output/jsonForXml ./output/xml

excel2eventTs <excelDirPath> <outDirPath>

事件 Excel 转 typescript 文件

参数说明

  • <excelDirPath>
    • 事件 Excel 所在目录
  • <outDirPath>
    • 事件 Excel 经过转换过输出 typescript 文件的指定目录

Excel 示例文件

excel/event/event.xlsx

注意:Excel 中红色部分不可修改; 事件名格式不可改变

使用示例

# 在项目根目录下执行
naruto-cli excel2eventTs ./excel/event ./output/event

tinifyCompressImages [options] <key> <imgDirPath>

使用 tinify 对图片进行压缩

参数说明

  • <options>
    • -ms, --minSize <minSize> 低于该大小的文件会被忽略,单位KB
    • -gp, --globPatterns <globPatterns> 符合该通配表达式的文件才会被压缩, 默认值为"*.png,*.jpg"
  • <key>
    • 在 [https://tinypng.com] 注册获取到的 key,每个用户有 500 张/月的免费压缩额度
  • <imgDirPath>
    • 图片目录,如果目录中有中文、空格、特殊符号,可以使用双引号将其包裹,如: "C:\Users\Naruto\Desktop\Img Panda"

使用示例

# 在项目根目录下执行
# 压缩10KB以上的jpeg图片和jpg图片
naruto-cli tinifyCompressImages -ms 10 -gp "*.jpg,*.jpeg" yourTinifyKey ./imgNeedCompress