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

moz

v0.2.1

Published

Moz is a front-end workflow build for static page.

Downloads

200

Readme

Moz

npm Travis

关于 Moz

Moz 集成了前端开发中调试,构建,部署,编译等一系列开发流程,帮助开发者提高开发效率;

使用指北

安装

Moz 依赖于 Node,需先安装 Node.js(建议使用LTS版本,目前最新版本为4.4.5),然后通过npm安装 Moz。

npm install moz -g

初始化

moz init

在项目文件夹使用 moz 初始化项目,初始化完成之后将会生成 moz 项目的目录结构以及配置文件 moz.config.js

初始化目录结构

.
├── app                 // 开发文件文件夹
│   ├── css             // 样式文件 *.less *.css
│   │   ├── partials
│   │   └── vendor
│   ├── js              // 脚本文件夹
│   │   └── vendor
│   ├── fonts           // 字体文件夹
│   ├── images          // 图片文件夹
│   ├── media           // 媒体文件夹
│   ├── template        // 模版文件夹
│   └── index.html
└── moz.config.js       // Moz 配置文件

初始化配置文件

module.exports = {
    name: 'Moz',
    serve: {
        port: 8080, // 调试服务端口
        open: '/', // 默认打开路径
        index: 'index.html' // 默认索引文件
    },
    build: {
        hash: true, // 是否使用 hash 缓存
        compress: {
            css: true, // 是否启用 CSS 文件压缩
            js: true // 是否启用 JS 文件压缩
        }
    },
    ftp: {
        host: '', // FTP 服务器
        user: '', // FTP 账号
        pass: '', // FTP 密码(允许为空,为空则在运行时提示输入密码)
        path: '/' // FTP 上传路径
    }
}

提示: ftp.pass 属性允许留空,在执行 deploy 任务时将提示输入密码 :P

本地调试

moz serve

运行后将会在项目文件夹启动一个 browser-sync 的静态文件服务器,实时编译 lessswig模版并自动刷新。

编译静态文件

moz build

运行后会将可以发布的静态文件编译并拷贝到 ./dist 文件夹内,如果开启了 rev 则会对静态资源文件加 hash 防止缓存。

发布静态文件

moz deploy

运行后会将 ./dist 目录中的所有文件通过 FTP 上传到 config.ftpPath 指定的路径上。

打包静态文件

moz pack // moz_1510291305.zip

moz pack -v 1.0.1 // moz_1.0.1.zip

运行后会将 ./dist 目录中的所有文件压缩成 zip 文件到 ./package 中,方便存档备份。

zip 文件的命名方式默认以 config.name_版本号.zip 命名,-v 参数可以指定版本号,不指定版本号则以当前时间作为版本号。