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

koro-cli

v1.1.0

Published

一个类似vue-cli的脚手架,用于学习脚手架开发理念:下载模板,通过命令行交互, 处理下载的模板

Downloads

61

Readme

一个类似vue-cli的脚手架

一个类似vue-cli的脚手架,用于学习脚手架开发理念:下载模板,通过命令行交互, 处理下载的模板

本项目基于:eos-cli

example:

全局安装:

npm install koro-cli -g

mac环境下要加sudo

如果你用npm安装失败,报权限问题用sudo也没有用,可以尝试一下用cnpm。(我遇到了这个问题,现在也不知道为什么会这样!)

演示

本地调试

下载项目。

安装依赖

npm install

监听变动,方便本地调试

npm run watch

修改配置文件位置:

本地调试将配置文件放在项目中,方便调试:

// constants.js
// 配置文件目录
// export const RC = `${HOME}/.kororc`;
export const RC = `./.kororc`; //本地调试将配置文件放在项目中,方便调试

创建配置文件:

npm run postinstall

本地开发的时候需要创建该文件,发布到npm上就不用了。

因为用户install之后,会自动执行npm run postinstall

执行 npm link

package.json上的配置,链接到全局, 此时就可以使用 koro 命令了。

mac 环境下要使用sudo npm link才能链接全局环境。

下载模板:

本项目是一个学习项目, 项目内置模板为一个只有readme仓库,然后只是简单的把用户选项放到新创建的:answer.txt文件中。

koro init testName // 下载模板到testName文件夹

修改下载仓库:

koro config set registry OBKoro1 // 修改用户
koro config set templateName codeBlack // 修改仓库名

自定义模板

正常情况下:应该根据用户命令行交互的命令,通过node.js来自定义项目模板,这一步需要大家自己做了。

发布

开发完成后,即可发布至 npm, 用户通过 npm install koro-cli -g 全局安装。 即可使用 koro 命令

注意事项:

  1. 更改package的bin属性即可更改命令名称
"bin": {
    "else": "./bin/www"
}

注意postinstall也要修改。

  1. 发布之前要将.kororc文件改回去:
// 配置文件目录
export const RC = `${HOME}/.kororc`; // 全局读取
// export const RC = `./.kororc`; // 本地调试将配置文件放在项目中,方便调试