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

truth-cli

v3.0.0

Published

A command-line tool for analyzing dependencies under node_moudles

Downloads

157

Readme

特点

  • 🤯体积小
  • ⚡️速度快
  • 🛠️功能丰富
  • 📱可视化展示
  • 💡友好的提示

快速开始

npx

# 启动网页
npx truth-cli web
# 生成 json 文件
npx truth-cli json
# 生成 txt 文件
npx truth-cli txt
# 生成 html 文件
npx truth-cli html

安装

npm install -g truth-cli

示例

# 启动网页
truth-cli web
# 生成 json 文件
truth-cli json
# 生成 txt 文件
truth-cli txt
# 生成 html 文件
truth-cli html

指定深度

深度只针对生成 jsontxt 命令 ,网页端采取动态加载节点的策略。

使用 --dep-d 参数:

truth-cli json --dep 2
truth-cli txt --dep 2

指定路径

truth-cli 默认在项目的根目录生成文件,如果想要更改路径,可以在将路径加在 --path-p 参数后

truth-cli json --path dist/
truth-cli txt --path dist/

WARNNING: 请不要再路径开头加上 /,这会被 nodejs 识别成根路径,从而生成失败

生成文件的格式

truth-cli json 命令会生成 pkgs.json 文件:

{
  "name": "_root_",
  "version": "1.0.0",
  "packages": {
    "@antfu/eslint-config": {
      "version": "^0.39.8",
      "type": 0,
      "packages": {
        // ...
      }
    }
  }
}

truth-cli tree 命令会生成 pkgs.txt 文件:

__root__ 1.0.0:
│
├─@antfu/eslint-config ^0.39.8
├─@changesets/cli ^2.26.2
├─@commitlint/cli ^17.7.1
├─@commitlint/config-conventional ^17.7.0
├─@rollup/plugin-commonjs ^25.0.4
├─@rollup/plugin-json ^6.0.0
├─@rollup/plugin-node-resolve ^15.2.0
├─@rollup/plugin-terser ^0.4.3
├─@rollup/plugin-typescript ^11.1.2
├─@truth-cli/core workspace:^
├─@types/minimist ^1.2.2
├─@types/node ^20.5.1
├─@vitejs/plugin-vue ^4.3.3
├─commitizen ^4.3.0
├─cz-git ^1.7.1
├─eslint ^8.47.0
├─husky ^8.0.3
├─lint-staged ^13.3.0
├─minimist ^1.2.8
├─prettier ^3.0.2
├─rollup ^3.28.0
├─ts-node ^10.9.1
├─typescript ^5.1.6
├─unplugin-auto-import ^0.16.6
├─unplugin-vue-components ^0.25.1
├─vite ^4.4.9
├─vite-plugin-compression ^0.5.1
├─vite-plugin-singlefile ^0.13.5
├─vitest ^0.34.2
├─vue ^3.3.4