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

reftool

v0.0.4

Published

![](./public/top.png)

Downloads

7

Readme

RefTool

npx reftool

What is this?

This tool provides essential information for understanding the total volume of a codebase, detecting duplicate code, and conducting efficient refactoring.
By setting up an OpenAI token, it can offer refactoring advice based on the diagnosed code data.

RefTool combines various refactoring tools into a user-friendly package, saving you the hassle of remembering different instructions for each tool.

It can be easily launched using npx, ensuring a hassle-free experience.

In the future, it is planned to include features like dead code detection and evaluation of code readability.

How to Use?

Start it from the command line:

npx reftool

You can also specify a project path:

npx reftool ./path/to/project

Or check two projects for duplicate code:

npx reftool ./path/to/project1 ./path/to/project2

Tip: If the detection doesn’t complete, try specifying the source code directory. Maybe you have a lot of files in your project that aren’t source code.

npx reftool ./src

How It Works?

RefTool uses tools like cloc and jscpd. It runs a local server to monitor and analyze files.
Future plans include integrating more tools like ts-prune. Suggestions for other tools are appreciated.


  • [x] モック画面の作成
  • [x] とりあえず static な path でいいから jscpd を実行して値をパースして一覧画面に飛ばす
    • パース結果はメモリに保持しておく
  • [x] 一覧画面でそれを受け取り、リスト表示する
  • [x] 詳細画面に遷移する
    • 遷移時にメモリに保持しておいたパース結果を ID or index でサーチして渡す
  • [x] ChatGPT をコールしてマークダウンとして表示する
  • [x] diff を表示する -> 一旦できたが使いずらいのでモナコを使う
  • [x] 節約できるコードのポテンシャルは重複コードの行数とイコールで良い(アバウトで OK)
    • 一覧画面上ではポテンシャルセーブで並び替えするべき
  • [x] cloc と組み合わせると良さそう
    • 全体を把握するのに役に立つ
    • プロジェクト全体の行数と重複コードの行数を比較すると良さそう
    • 増えた減ったが後から追えると見える化ができて良さそう
  • [x] 複数(2 つ)の調査対象に対応する
  • [x] watch で指定しているディレクトリが更新されたら診断を再実行する
  • [x] 初期のローディング画面
  • [x] npx で起動してローカルでサーバーが立ち上がる(インストール不要)
  • [x] Open AI のトークンを設定できるようにする(ローカルストレージ)、ストリームできるようにする
  • [x] How it works、How to use の説明を README に書く
  • [x] beta リリース
  • [x] カスタマイズ
    • [x] jscpd のオプションをカスタマイズできるよにする
    • [x] ChatGPT のプロンプトをカスタマイズできるようにする
  • [ ] ts-prune を使う
  • Duplicated Code の readmore
  • cloc をスナップショットを撮れるようにする?
    • https://tailwindui.com/components/application-ui/data-display/stats#component-72704cac437a06d94cdb941c274591ba
    • 過去と比較してどのくらい減ったか表示したい
  • [x] FIXME を直す