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

bowljs-cli

v1.0.5

Published

Command line tools for Bowljs

Downloads

5

Readme

Bowljs CLI(Command Line Interface)

Bowljs CLI为基于Bowl.js的模块化开发提供工具支持。

安装

Bowljs CLI运行于Node.js环境,您必须先安装Node.js(4.0.0或以上版本),然后在命令行中输入:

npm install bowljs-cli -g

使用

构建

为了提高性能,发布到生产环境的Javascript代码一般要经过压缩处理,甚至要对一些文件进行合并。Bowljs CLI提供了构建工具完成上述工作。该工具的最简单用法是:

bowljs build <目标路径>

其中「目标路径」参数可以是一个文件或者一个目录,为目录时则构建该目录下的所有文件。要注意的是,构建工具只会对开发版本的文件(文件名为「*-debug.js」)进行构建,其他文件会被忽略。构建结果即同目录下不带「-debug」的文件(生产版本),例如「ajax-debug.js」的编译结果为「ajax.js」。

构建工具还可以在构建模块的时候把所有或部分依赖的模块合并进来,以节省HTTP请求。合并功能需要一个配置文件指定合并规则(详见此处)。

在执行bowljs build命令的时候,如果「目标路径」参数是一个目录并且该目录下有一个叫做「package.settings」的文件,那么该文件就会被自动加载为配置文件。否则就需要指定配置文件路径:

bowljs build <目标路径> --settings <配置文件路径>

生成文档

API文档有助于团队成员了解各个模块的功能。通过Bowljs CLI的文档生成工具,只要把文档的内容以特定格式的注释(规则见此处)写在源代码中,就可以批量生成文档。

生成文档同样需要一个配置文件,配置项见此处。把该配置文件保存为document.settings,并放置于目标目录下,然后执行以下命令就可以生成文档:

bowljs doc <目标目录>

如果配置文件不在目标目录下,也可以通过参数指定其路径:

bowljs doc <目标目录> --settings <配置文件路径>

作为依赖包使用

Bowljs CLI也可以作为依赖包使用,具体说明见此处