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

mip-cli-test

v1.0.7

Published

Command line interface for MIP

Downloads

19

Readme

MIP CLI 工具

MIP脚手架.

安装

依赖环境: Node.js (>=4.x).

$ [sudo] npm install -g mip-cli

注意: nodejs 5.x, 6.x 安装模块时,可能会报node-gyp相关错误,需要使用如下命令安装

$ [sudo] npm install --unsafe-perm -g mip-cli

nodejs 5.x 安装bufferutil模块时可能会报编译错误,建议使用4.4或者6.x以上版本。

使用

在当前项目根目录中初始化mip配置:

$ mip init

会创建mip.config文件,相关配置如下:

module.exports = {

    /**
     * mip server调试的端口号
     *
     * @type {number}
     */
    port: 8000,

    /**
     * 本地mip网页后缀名,会对mip网页动态添加调试脚本
     *
     * @type {RegExp}
     */
    mipPageExt: /\.(?:html|htm|mip)$/i,

    /**
     * 本地mip组件调试目录,主要用于开发组件时进行本地调试,自动将本地mip组件注入到当前访问的页面中
     * 例如:配置'../mip-extensions',会将此目录的组件注入到调试页面
     *
     * @type {string}
     */
    extensionsDir: '',

    /**
     * 本地mip调试目录,用于调试本地mip项目
     *
     * @type {string}
     */
    mipDir: '../../../mip',

    /**
     * 启用调试页面自动刷新
     *
     * @type {boolean}
     */
    livereload: true
};


在当前项目创建一个mip模板网页:

$ mip add index.html [mip-xxx...]


mip-extensions仓库中创建一个mip组件:

$ mip addelement mip-demo


验证mip网页:

$ mip validate index.html [...]


在当前项目或者mip-extensions仓库中启动mip网页调试器:

$ mip server

注意:调试mip-extensions仓库组件时,会读取组件中READEME.md的使用示例,因此组件的README.md中 应至少包含一段使用示例:

配置了mipDir之后可以调试mip引擎。

mip server 启动多个实例的话会报端口占用错误,需要关闭其他实例或者kill掉占用端口的进程后再启动。

➜  ~ mip server
INFO livereload server start at: http://172.20.128.110:35730
ERROR PORT 8000 already in use, please retry again!


在当前项目中,校验编写的mip组件,可以校验mip组件目录或者mip组件压缩包:

# directory
$ mip validateelement ./mip-demo
# zip package
$ mip validateelement ./mip-demo.zip


更新mip工具,将mip模板更新到最新版本:

$ mip update


直接从官方 npm registry 安装,可能会由于网络原因,导致安装时间较长或安装失败。此时我们可以选择速度更快的 registry。

$ [sudo] npm install -g mip-cli --registry=https://registry.npm.taobao.org

预览组件

进入mip-extensions仓库,使用mip server命令启动调试器 访问 http://127.0.0.1:8000查看看组件列表,点击组件链接进行预览

License

MIT