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

tars-node-server-generator

v1.2.2

Published

Tars node server generator

Downloads

7

Readme

Tars Node Server Generator

这是一个 Node Web 服务的脚手架工具,通过该工具可以快速生成一套具备读取 Tars 配置、写 Tars 日志、集成前端工程化工具的 Express Web 服务。

一、安装

npm install tars-node-server-generator -g

Tarsns 生成的项目依赖 nodemon 工具,如果没有安装过请执行:

npm install nodemon -g

注:nodemon 是一个文件监控工具,当被监控文件发生变化时会自动重启该 Node 服务,相关配置可以在nodemon.json中修改。

二、创建及启动工程

默认工程


tarsns create <ProjectName>

运行命令后会生成以下目录及文件:

<ProjectName>/
    ├── lib/
    │ ├── configLoader.js
    │ └── logger.js
    ├── public/
    ├── routers/
    │ ├── home.js
    │ └── index.js
    ├── views/
    │ ├── error.ejs
    │ └── index.ejs
    ├── .gitignore
    ├── app.js
    ├── nodemon.json
    ├── package.json
    ├── server.js
    └── <ProjectName>.conf

注意事项:

  • 项目名称:<ProjectName> 必须与 Tars 服务名称一致,手动修改<ProjectName> 会导致程序运行错误。
  • 程序端口:Tarsns 生成的项目默认端口为4000,可以在package.jsonconfig.port字段中进行修改。

Tars协议服务


tarsns create <ProjectName> --tars <AppName>

运行命令后会生成以下目录及文件:

<ProjectName>/
    ├── <ProjectName>.conf
    ├── app.js
    ├── lib
    │   ├── configLoader.js
    │   ├── error.js
    │   └── logger.js
    ├── nodemon.json
    ├── package.json
    ├── proxy
    ├── server.conf
    └── tars
        └── <ProjectName>.tars

注意事项:

  • 项目名称:<AppName>为应用名称,<ProjectName> 为服务名称,必须与 Tars 应用和服务名称一致,手动修改<ProjectName> 会导致程序运行错误。
  • 程序端口:Tarsns 生成的项目默认端口为14009,可以在server.conf文件中进行修改。

四、其它问题

生成项目使用了 ES6 语法,IDEA、WebStorm 等 IDE 需要设置下语言支持: Preferences > Languages & Frameworks > JavaScript > JavaScript language version 设置为 ECMAScript 6 即可。

帮助命令:

Tarsns -h