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

@viocha/tsr

v0.3.4

Published

A simple TypeScript Node.js runner

Readme

tsr — TypeScript Runner

Run TypeScript files instantly.
A CLI tool for compiling and running .ts files with zero config, powered by esbuild and Rollup.


✨ 特性 Features

  • 🚀 快速执行:一条命令立即运行 .ts 文件
  • 🔧 无需配置:零配置使用,适合脚本调试和原型开发
  • 🧱 构建支持:可构建为独立 ES 模块输出
  • 📦 支持 CommonJS、JSON 和 NODE_PATH
  • 🧹 自动清理:执行后的临时文件自动删除

📦 安装 Installation

npm install -g @viocha/tsr

或本地使用:

npm install @viocha/tsr --save-dev

🚀 快速开始 Quick Start

运行 TypeScript 文件

tsr hello.ts

或者

tsr run hello.ts

支持传参:

tsr run hello.ts arg1 arg2

仅构建,不运行

tsr build hello.ts

输出文件默认为 out/hello.js,也可自定义路径:

tsr build hello.ts -o dist/output.js

⚙️ 可选参数 Options

tsr build

| 参数 | 描述 | |-------------------------|------------------------| | -o, --out <path> | 自定义输出文件路径 | | -e, --external <deps> | 指定外部依赖(逗号分隔),不会打包进输出文件 |

示例:

tsr build src/index.ts -o dist/index.js -e lodash,react

📁 示例文件 Example

// hello.ts
console.log('Hello,', process.argv[2] || 'World!');
tsr run hello.ts TypeScript
# 输出: Hello, Typescript!

🔍 实现原理 Behind the Scenes

  • 使用 esbuild 快速编译 TypeScript 为 JavaScript
  • 使用 Rollup 优化构建结果,支持 CommonJS/JSON
  • 使用 tmp 创建临时执行文件,运行完毕后自动清除
  • 自动解析 NODE_PATH 中的模块路径

📄 License

MIT