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

template-cli-core

v1.1.16

Published

template generator

Readme

template-cli

命令行模板生成

安装

npm i template-cli-core -g # npm安装

生成项目

tpl project

tpl p # 简写

生成模块或组件

  • 安装需要使用的模板package

  • 执行生成命令

    tpl generate
    
    tpl g # 简写
  • 根据命令选择需要生成的组件并初始化组件参数

  • 模板可直接使用angular schematics,但需要将package前缀命名为template-cli-schematics-

生成接口

  • 在项目根目录下创建如下generate.conf.js配置文件

    module.exports = {
        path: './api', //生成后保存路径
        serviceTemplatePath: './template/service.js', // 接口模板
        entityTemplatePath: './template/entity.js', // 实体模板
        include: [
            {path: '/user/**'},
            {path: '/test/**', methods: ['get']},
        ], // 需要生成的接口
        exclude: [
        //     {path: '**', methods: ['delete', 'put', 'options', 'patch', 'head']},
        //     {path: '/error'},
        ], // 排除需要生成的接口,会覆盖include配置
        projects: [
            {
                url: 'http://192.168.1.146:8520/v2/api-docs', // swagger地址
                data: { // 接口信息,可在模板中获取
                    baseUrl: 'common',
                    prefix: ''
                }
            },
        ],
        assetsPath: './template/assets', // 需要直接生成的资源文件
    };

    模板可参考node_modules/api-service-generator/template路径下的entity.jsservice.js,模板语法采用mustache

  • 执行生成命令

    tpl api
    
    tpl a # 简写

开发

  • git clone克隆代码到本地

  • npm i安装依赖

  • 开发完成后,npm run build打包

  • npm publish发布到npm仓库