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 🙏

© 2026 – Pkg Stats / Ryan Hefner

xgen-cli

v0.1.21

Published

根据数据库自动生成前后端项目

Downloads

48

Readme

xgen-cli

NPM version NPM downloads

xgen 命令行程序。根据数据库自动生成SpringBoot项目,带FreeMark 前端html模版,如果生成总个项目同时还带有reactjs工程。 目前仅支持MySql数据库

目前有三个 templates

  • blackgreen
  • ubold
  • default

Install

$ npm install -g xgen-cli

Usage

xgen p

$ mkdir myApp && cd myApp
$ xgen p dbname 127.0.0.1 root 123 3306
$ make

最后一个参数是端口号,如果默认是3306端,可以不写。

option

  Usage: xgen <command> [options]

  Options:

    -h, --help     output usage information
    -v, --version  output the version number

  Commands:

    server        在当前目录创建server端程序,短参数 "s"
    client        在当前目录创建client端程序,短参数 "c"
    project       创建一个工程包含server和client端,工程名字要和数据库名一致,短参数 "p"
    generate      在当前目录生成server或者client文件,短参数 "g"

  所有参数可以使用 -h (或 --help)来查看使用方式.

  Example All:
    xgen p app 127.0.0.1 root 1234 3306
    xgen p -t blackgreen app 127.0.0.1 root 1234 3306 自定义主题

  Example Server:
    xgen s com.spring.demotest jar demodb 127.0.0.1 root 1234 3306
    ->com.spring.demotest:  程序包名
    ->jar:  spring的启动方式,分为jar 、 war 方式
    xgen s -t blackgreen com.spring.demotest jar demodb 127.0.0.1 root 1234 3306     #自定义主题
    ->-t:  指定主题名称

  Example Single Java file:
    xgen g -s model account com.spring.single demodb 127.0.0.1 root 1234 3306
    ->account: 表名称
    ->com.spring.single: 程序包名
    xgen g -st blackgreen model account com.spring.single demodb 127.0.0.1 root 1234 3306  #生成指定模版
    ->-t:  blackgreen 模版名称

xgen g 单个文件生成

server端单个类代码,生成model的时候,会有model,mapper.xml, mapper.java, page.java, service.java, serviceImpl.java, xxx.html, xxxController.java

$ xgen g -s model account com.spring.single demodb 127.0.0.1 root 1234 3306;
$ xgen g -s service account com.spring.single demodb 127.0.0.1 root 1234 3306;
$ xgen g -st blackgreen model account com.spring.single demodb 127.0.0.1 root 1234 3306  #生成指定模版

client 端单个js代码

$ xgen g -c model tablename demodb 127.0.0.1 root 123 3306;

option

  Usage: xgen g [options] <command>

  Options:

    -h, --help     output usage information
    -c             output the client files
    -s             output the server files

  Commands:

    model         生成model相关文件 (server or client)
    service       生成service相关文件 (server or client)
    route         生成route文件 (client)
    component     生成component文件 (client)
    all           生成全部文件 (client)

License

MIT