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

portable-cli

v1.0.3

Published

一个简易的支持自定义模板的脚手架

Downloads

5

Readme

portable-cli

一个简易的脚手架,目前已经配置两个模板

  • blog:一个使用 issue 来写 blog 的模板,预览 issues blog
  • admin:一个 Vue + element ui 的后台管理系统,预览 admin-system

使用

  1. 安装
npm install -g portable-cli
  1. 查看模板
portable-cli list

➡️  Template name: blog, Github address https://github.com/niexia/issues-blog-template.git
➡️  Template name: admin, Github address https://github.com/niexia/vue-element-admin.git
  1. 使用模板创建项目
# portable-cli create <template-name> <project-name>

portable-cli create blog my-blog

PORTABLE CLI v1.0.2
📦 Creating project in /Users/yangjin/Documents/enrich-github/my-blog.

⠋  Download project template. This might take a while...

🗃  Initializing git repository...

🎉  Successfully created project my-blog.
  1. 添加模板
# portable-cli add <template-name> <git-repo-address>

portable-cli add my-blog-template https://github.com/niexia/issues-blog-template.git

🎉  Successfully add project template my-blog-template.

# list template

portable-cli list

➡️  Template name: blog, Github address https://github.com/niexia/issues-blog-template.git

➡️  Template name: admin, Github address https://github.com/niexia/vue-element-admin.git

➡️  Template name: my-blog-template, Github address https://github.com/niexia/issues-blog-template.git
  1. 删除模板
# portable-cli delete <template-name>

portable-cli delete my-blog-template 

? Make sure that you want to delete the template my-blog-template? Yes

🎉  Successfully delete project template my-blog-template.

为什么需要脚手架

随着项目逐渐复杂和增加之后

  1. 每个项目都需要设置一样的配置,复制粘贴
  2. 多个项目的配置和结构容易出现不统一,不好管理

通过使用脚手架,配置一系列的指令,同时定义好不同选择对应的模板,就可以根据实际情况的选择,直接生成一套合适的项目代码,解决上面的问题。

设计

在脚手架内部提供一些能力,和用户进行交互

  1. 根据不同场景定义好对应的模板,统一项目结构,相关的代码设计
  2. 脚手架通过命令式和用户进行交互,选择对应的模板进行初始化项目
  3. 脚手架和模板解耦,支持对模板进行管理

License

MIT