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 🙏

© 2025 – Pkg Stats / Ryan Hefner

lanren-ts-cli

v1.0.0

Published

ts-cli 用 TypeScript 打造的第一个命令行工具

Readme

ts-cli

ts-cli 用 TypeScript 打造的第一个命令行工具

參考 ts-test 建立 TypeScript 專案

初始安裝

npm ci

安裝 ts-node

ts-node 是一個工具,它允許您直接運行 TypeScript 代碼而無需事先將其編譯為 JavaScript。這樣可以加快開發速度並簡化工作流程,特別是在開發和測試時。

npm install -g ts-node

安裝 .env 設定檔案

npm install dotenv

CLI 名稱修改

打開 package.json 檔案

"bin": {
    "tscli": "./dist/src/index.js"
  },

修改 tscli 成為你想要的名稱

🔅編譯專案內的 .ts 檔案

🔅會更新到 dist 目錄內

tsc

開啟監聽 ts 文件自動編譯

tsc -w

原始程式碼連結安裝

⭐程式碼異動,都必須先移除連結再重新安裝。

npm link

這個指令將會幫助你把這個資料夾放進你的全域node module 中, 這樣你就不用部署到 npm 上就能直接使用。

原始程式碼連結解安裝

⭐程式碼異動,都必須先移除連結再重新安裝。
ts-cli 是 package.json 檔案 name 的欄位內容

npm unlink ts-cli

CLI 範例測試

tscli 是 package.json 檔案 bin 的欄位內容

tscli -d 1234

abstract syntax tree

npm install ts-morph
tscli -a 1

安裝 Redis 套件

npm install redis @types/redis

讓 -u 支持 Redis 查詢

git commit message

  • 常用描述
✨ feat: 需求功能描述
🐛 fix: 修正 bug 的問題描述
💄 optimize: 最佳化程式碼或功能流程
🔧 chore: 雜事,例如: 調整設定檔案等等 

安裝 ts-cli 到全域

.\install.ps1