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

ts-bin

v1.2.5

Published

ts项目启动编译容器

Downloads

4

Readme

ts-bin

使用 ts-bin 可以让你实现 build ts

Install

npm install ts-bin -D
ts-bin dev --app ./src/app.ts

Usage

ts-bin dev

启动 dev 模式, 默认 NODE_ENV = 'local' (可以指定)

$ ts-bin dev --app

options

  • --env 环境变量; 默认 local
  • -h, --host [value] 启动ip; 默认 0.0.0.0
  • -p, --port [value] 启动port; 默认 8000
  • --app [value] 启动入口; 默认 ./src/app.ts
  • --exec "[value]" 启动脚本; 默认 node
  • --args "[value]" 额外参数; 默认 无
  • --tsconfig [value] typescript文件配置; 默认 process.cwd() + /tsconfig.json

ts-bin watch

启动 watch 模式, 默认 NODE_ENV = 'local' (可以指定), 监听文件修改后重启服务

options

  • --env 环境变量; 默认 local
  • -h, --host [value] 启动ip; 默认 0.0.0.0
  • -p, --port [value] 启动port; 默认 8000
  • --app [value] 启动入口; 默认 ./src/app.ts
  • -w, --watch "[value]" nodemon 监控文件列表; 默认 ./src/
  • -i, --ignore "[value]" nodemon 忽略监控文件列表; 默认 无
  • --exec "[value]" nodemon启动脚本
  • --args "[value]" 额外参数; 默认 无
  • --tsconfig [value] typescript文件配置; 默认 process.cwd() + /tsconfig.json

ts-bin debug

启动调试模式, 类似于 node --inspect

options

  • --env 环境变量; 默认 local
  • -h, --host [value] 启动ip; 默认 0.0.0.0
  • -p, --port [value] 启动port; 默认 8000
  • --app [value] 启动入口; 默认 ./src/app.ts
  • --inspect [value] 监听端口: 默认 0.0.0.0:9229
  • --inspect-brk [value] 监听端口,启动时打断点
  • -w, --watch "[value]" nodemon 监控文件列表; 默认 ./src/
  • -i, --ignore "[value]" nodemon 忽略监控文件列表; 默认 无
  • --exec "[value]" nodemon启动脚本
  • --args "[value]" 额外参数; 默认 无
  • --tsconfig [value] typescript文件配置; 默认 process.cwd() + /tsconfig.json

优先级: --inspect-brk value > --inspect value > 默认值 '--inspect=0.0.0.0:9229'

ts-bin build

启动 build, 将ts打包成js, 默认会将 process.cwd() + '/build/**' 打包进代码里

options

  • --framework 是否打包框架; 默认打包应用
  • --tsconfig [value] typescript文件配置; 默认 process.cwd() + /tsconfig.json
  • --ignore-tar 是否忽略达成tar.gz包; 默认打包成 包名.tar.gz
  • --ignore-install 是否忽略安装; 默认 安装node_modules包
  • --name [value] 打包后报名; 默认 package.json 的 name 字段
  • --src "[value]" 编译目录; 默认 ./src/
  • --dist "[value]" 编译后目录; 默认 ./dist/
  • --nodemodules-tar 是否打包node_modules
  • --after-build "[value]" 编译后执行命令
  • --copy-nodemodules 是否copy node_modules目录,默认采用 install 模式

ts-bin start

启动 build 后的js项目, 试用任何启动后台进程的node 服务, 如 koa,express等

options

  • --env [value] 设置 NODE_ENV 环境变量; 默认 production
  • -h, --host [value] 启动ip; 默认 0.0.0.0
  • -p, --port [value] 启动port; 默认 8000
  • --name [value], '应用名称; 默认 package.json 的 name 字段
  • --app [value], '应用入口文件; 默认 process.cwd() + /dist/app.js
  • --exec "[value]" 启动脚本; 默认 node
  • --args "[value]" 额外参数; 默认 无
  • --runtime "[value]" 临时缓存文件夹; 默认 process.cwd() + /runtime/
  • --daemon 守护进程; 默认不开启

ts-bin stop

停止由 ts-bin start 启动的后台进程服务

options

  • --name [value], '应用名称; 默认 package.json 的 name 字段

TIPS