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

newkit-cli

v0.5.3

Published

Newkit cli tools.

Downloads

28

Readme

Newkit-cli

Newkit-cli,是用于辅助 newkit 开发的 node 模块,我们可以用它来初始化 newkit 开发环境,升级 newkit 到特定版本,或者是直接将开发好的模块打包发布到gdev。

优点

  • 安装方式简单,通用。仅仅需要通过 npm install newkit-cli -g 就能直接安装好模块。
  • 自动检查 newkit-cli 版本,有新版本即时通知更新。
  • 使用方便。通过git风格的命令行来执行特定的操作: nc <command>
  • 实用,为搭配 newkit 为生,解决使用 newkit 开发的部分痛点。

如何安装?

首先,必须先安装好 node 环境(打开https://nodejs.org/en/,选择合适的版本下载安装。),这里推荐使用 4.x LTS 版本,如果想尝鲜,也可以选择 6.x 版本。

注意:要运行 newkit-cli, 必须保证node版本 >=4.0.0

在安装好 node 环境之后,npm也随之可用,此时在控制执行 npm install newkit-cli -g 即可安装 newkit-cli。如果不了解npm,请看 这里

安装结束后,在控制台输入 nc -V, 如果返回 newkit-cli 的版本号信息,说明已经成功安装。

如何使用?

newkit-cli 当前提供的功能还不太多,我们会根据实际的使用需求,增加更多方便的功能。

1、初始化 newkit

要使用 newkit 来开发的第一步,就是要先初始化,这个操作可以通过 newkit-cli来实现。

首先,我们需要新建(打开)一个空目录(初始化操作必须要在空目录执行),然后在地址栏输入 cmd, 回车进入控制台,然后执行命令 `nc init`` 开始初始化进程。

2、检查本地 newkit 版本和当前已发布的最新版本

newkit 的根目录进入控制台。执行命令 nc check,控制台将会输出本地版本号和远端版本号。

3、更新 Newkit 到特定版本

newkit 根目录进入控制台,执行命令 nc update,先会检查本地版本和远端版本,如果版本号不一致,将会直接更新到远端的最新版本。

如果想要更新到特定的版本,需要执行命令 nc update <version>,通过指定版本号,来更新到指定的版本。(更新时,建议都更新到最新版本)。

From 0.0.7

增加 -f, --version 参数,允许不检查版本,直接更新。

4、打包模块

我们在开发好模块之后,一般会先将模块发布到gdev进行测试,这个时候需要先打包模块,newkit-cli 也提供了打包模块的命令,通过执行 nc pack <module>,可以将 dist/ 下指定的模块打包,并保存到 root/packed 目录下。

注意:由于是打包的 dist/ 下的模块目录,打包前请先通过 gulp -r 生成 dist 目录

5、发布到GDEV

使用 nc deploy <module> 可以将打包好的模块发布到 GDEV 环境。此命令是将 oot/packaed/ 目录下的指定模块压缩包,提交到 GDEV,所以需要先通过 nc pack <module> 先打包文件。

From 0.0.7

增加 -m, --memo-v, --version,可以在上传时,设置memo和version属性。

例如: nc deploy app-test -m 一次测试提交 -v 0.99

6、检查模块代码

使用 nc jshint <module> 可以使用jshint来检查指定的模块代码,并生成结果报告。

7、清空dist目录

使用 nc clean 可以直接清空dist目录。

如何使用2(从 0.2.0 开始,提供对 newkit2 的支持,命令为 nk

1、初始化 newkit 框架

nk init

注意:必须为空目录,才可执行该命令

2、创建模块模板

此命令将会在 src/modules 下创建指定的模块

nk create <module>

3、更新框架

此命令用于更新框架,如果指定版本,则更新到指定的版本

nk update [version]

4、生成公共模块的 type file

nk types <module>

注意:一定要在模块的 app.ts 中导出所有内容

5、检查模块代码

nk lint [module]

注:如果不提供模块,会默认检查所有 modules 下的模块

How to Test?

该项目使用 coffee 来进行测试,首先,需要 npm install coffee -g

Other

newkit-cli 启动后,会自动检查更新。如果发现有新版本,会在控制台提示升级。此时需要通过执行 npm install newkit-cli -g 来升级到最新版本。