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

7hoo-autocode

v0.3.7

Published

代码自动生成器,从代码模板生成业务代码

Downloads

18

Readme

autocode

copy template code directory or file into your business module directory. 复制模板代码目录或文件到您的业务模块目录.

###How to use?

  1. 全局安装: npm install -g 7hoo-autocode
  2. 进入你的项目工程根目录, 运行: autocode init该方法会在根目录下自动生成__.autocode__文件夹及其子文件夹和文件
  3. 进入__.autocode__目录, 编辑__config.json__, 设置您的个人信息、您想自动生成的模块所存放的目标目录和模块名的对应关系
    配置文件中默认使用__.autocode/tpl__作为您的代码模板目录, 您也通过修改这里的配置实现自定义自己的代码模板目录
  4. 把你的代码模板放入上一步配置的代码模板目录里
  5. 运行: autocode yourModule yourCustomModuleName

###Placeholder

使用双花括号作为占位符: {{yourVariable}}

###Filter 占位符支持过滤器, 使用|作为过滤器开关: {{yourVariable|yourFilter}}
目前支持五种过滤器: capitalizexapitalizecamelizetoLowerCasetoUpperCase

###Inner Variable

autocode包含如下内置变量: __filepath____filename____date____moduleprefix__, 这些变量可用于代码模板内.

  • __moduleprefix__: 该变量的值是上一步的 yourCustomModuleName
  • __filepath__: 生成的文件的路径
  • __filename__: 生成的文件名
  • __date__: 生成文件的日期

###Additional

在上述How to use?第5步中的yourModule对应于代码模板目录下各子目录名.
比如 .autocode/tpl/ui 对应的yourModule为__ui__