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

zk-init

v1.0.25

Published

各种项目初始模板生成工具

Downloads

32

Readme

项目初始化结构生成工具

搭建过程

创建npm账号

官网上注册一个npm的账号

本地的npm添加账户(上一步注册得账号)

$ npm add user

查看当前的用户是谁

$ npm whoami

发布到npm官网上

$ npm publish

注意:每次发布得时候记得改依稀package.json中的版本号,否则会发布失败

按git标签发布

$ npm publish --tag 0.1.0

创建全局工具的方式

package.json中配置

"bin": {
    "zk-init": "./bin/zk-init.js"
}

zk-init.js文件写法

#!/usr/bin/env node
if (process.argv.length === 3 &&
    (process.argv[2] === '-v' || process.argv[2] === '--version')) {
    console.log(require('../package').version);
    return;
}

注意:#!/usr/bin/env node,表明整个文件将以node方式运行,zk-init.js是一个node环境,要什么功能自由发挥吧。

获取命令行参数有一个开源模块commander,可以生成版本信息 帮助信息等。这里是官网

使用方式

发布之后就可以通过npm安装了

$ sudo npm install zk-init -g

查看版本

$ zk-init -V // 大写得v
或
$ zk-init --version

查看帮助

$ zk-init -h
或
$ zk-init --help

示例

$ zk-init jquery-simple

you will get:
- css
- js
- index.html

需要创建的项目模板

前端的项目,只提供webpack打包方式,提供less等集成

simple: // 无构建工具,只用html+css+js webpack: // webpack 构建,提供less webpack-dev-server

  • jQuery
    • jQuery simple // 无构建工具,只用html+css+js
    • jQuery webpack
  • BootStrap
    • BootStrap simple
    • BootStrap webpack
  • React
    • React webpack
  • node
  • python
  • java

实现思路

模板都单独放到github上,通过命令clone下来,并把.git文件夹删掉。这种方式不好,运行速度太慢了,而且断网情况下无法使用。