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 🙏

© 2026 – Pkg Stats / Ryan Hefner

js-code-detector

v0.0.57

Published

- 重复代码检测工具, 支持 React、Vue 项目 - git分支对比报告, 目前适用于 umi4.x 版本的项目

Readme

js-code-detector

说明

  • 重复代码检测工具, 支持 React、Vue 项目
  • git分支对比报告, 目前适用于 umi4.x 版本的项目

重复代码检测使用

  • 项目安装 js-code-detector
  • package.json 中添加 scripts 命令 sameCodeDetect, 例如:"same": "sameCodeDetect"
  • 执行该命令可在当前项目目录下生成报告, npm run same

git分支对比报告使用

  • 项目安装 js-code-detector
  • package.json 中添加 scripts 命令 gitDiffDetect, 例如:"detect": "gitDiffDetect"
  • 执行该命令可在当前项目目录下生成报告, npm run detect

重复代码检测报告说明

1.所有相似的代码片段为一组,每组有2个及以上的代码片段 2.每组代码片段都有对应的文件路径,以及所在的行范围

git分支对比报告说明

  • 文件路径
  • 改动类型 add remove modify
  • 依赖当前文件的文件
  • 危险标识符(包括 1、找不到定义的, 2、函数的参数是一个函数,并进行调用的)
  • 区块报告(每个diff块产生一个报告)
    • 区块类型,目前把重点的类型单独提取处理,包括 "Import"|"Declaration"|"Assignment"|"SelfUpdate"|"Invoke"
    • 区块的原始改动内容
    • 增加的标识符
    • 增加的标识符的影响
      • 增加的标识符的来源
      • 影响到的标识符的位置

LICENSE

MIT