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

dong

v0.7.0

Published

yet another fed tool

Downloads

70

Readme

dong

NPM version

      ___
  ____/ /___  ____  ____
 / __  / __ \/ __ \/ __ \
/ /_/ / /_/ / / / / /_/ /
\____/\____/_/ /_/\__, /
                 /____/

又一个前端工具

安装

$ npm install -g dong
# MUST
$ dong patch

国内环境,对以上两个命令添加参数 --registry https://registry.npm.taobao.org,可提高安装速度

更新

$ dong update -R

更新后会自动执行 dong patch -R

使用

1、查看帮助

$ dong [command] -h

2、初始化项目

$ dong init [type]

# Single Page Application
$ dong init spa

# General Web Project
$ dong init web

3、项目构建

$ dong build [type]

# Single Page Application
$ dong build spa

# General Web Project
$ dong build web

参数

-r, --root <root>    Web 服务根目录,默认 `.`
-v, --views <views>  视图文件,默认 Web 服务根目录下的 `*.html`
-i, --i18n <i18n>    需要构建的语言版本,默认不区分语言
-f, --force          先清空输出目录
-d, --debug          DEBUG, 仅生成 `seajs 及其 config.js`

特性

  • [x] 增加代码检查(JSHINT)
  • [x] JS 文件打包压缩
  • [x] 资源 MD5 值生成
  • [x] 资源链接添加 MD5 串
  • [x] CSS 文件生成与压缩
  • [x] 构建多语言版本
  • [ ] 替换多语言后的代码检查

4、提取待翻译字段

$ dong i18n

5、启动 Web 服务

$ dong serve

参数

-r, --root <root>  Web 服务根目录,默认 `.`
-H, --host <host>  服务域名,默认 `127.0.0.1`
-p, --port <port>  监听端口,默认 `9527`
-m, --mock <mock>  接口请求模拟数据存放目录,默认 `api`
-o, --open         服务启动后,自动在浏览器打开,默认 `false`
-d, --debug        显示 Debug 信息,默认 `false`

特性

  • [x] 静态文件服务
  • [x] 模拟接口请求
  • [ ] 自动编译 SCSS
  • [ ] 自动重启服务

6、代码检查

$ dong check

参数

-s, --src <src>               文件路径,支持 glob(以空格分隔多个),默认 `**/*.js`
-t, --threshold <threshold>   最大允许显示的错误数量,默认 `10`

特性

  • [x] 基于 JSHINT 的代码检查
  • [ ] 代码复杂度分析
  • [ ] 集成单元测试及覆盖率?

7、文档生成与发布

$ dong doc

参数

-w, --watch        监视目录变化
-s, --serve        启动 Web 服务
-p, --port <port>  Web 服务端口
-o, --open         服务启动后,自动在浏览器打开
-r, --release      发布到 gh-pages
-d, --debug        显示调试信息

TODOs

  • [ ] 自动同步代码到 SVN
  • [ ] 从接口(定义)生成模拟数据
  • [x] 工具增量更新