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

robot-tool

v2.0.4

Published

自动生成代码工具

Downloads

8

Readme

做一个代码生成的工具项目

没有在window平台下做过测试。使用起来可能会有点问题。个人项目 请谅解

文件结构

bin 命令行目录
templateStore 模板库

功能要求

设置生成语句语言
tool set php
tool set rootPath

  1. 生成单文件或模块的功能
    生成 - 类型 - 框架:类型(模板类型) - 名称(加相对路径即为)
    tool generate template php:laravel:controller App/Web/Controller

    tool g toolConfig 在当前项目中生成配置文件
    tool g p(project) -l git 列出可用脚手架
    tool g p fromprojectname toprojectname
    (该命令需要在git.json里边自己设置常用的git库,目前我只放了三个项目)

    一个模块是一个文件夹。单文件也算模块
    文件结构如下:
    --module
    --moduleFile 可能是文件,可能是文件夹
    --readme.md 模块描述文件
    --config.json 模块配置文件 通过该配置文件去分配文件路径,和文件内的字符串替换

  2. 生成一个模板文件
    生成模板文件
    tool init -t template -p js/vue/list.vue
    (生成之后会有提示)

    生成配置描述文件
    tool init -t template-config -p js/vue/list.vue

    查看帮助
    tool init --help 查看使用

    注,模板变量可以直接做一下操作,不用再重新定义变量 变量名 model_name 首字母大写 model_name_firstUpperCase
    首字母小写 model_name_firstLowerCase 全部小写 model_name_toLowerCase 全部大写 model_name_toUpperCase

  3. 查看目前有的模板
    tool ls -t php -f laravel
    tool -h

// TODO
4. 执行常用shell脚本

// TODO
配置文件中可以设置语言,然后根据框架的结构,初始化包名,使代码初始化更简洁

// TODO
根据做过的项目来做代码总结