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 🙏

© 2026 – Pkg Stats / Ryan Hefner

biz-server

v0.2.3

Published

biz mock server

Downloads

124

Readme

biz-server: http server and mock

NPM version NPM downloads total NPM license Build Status Dependency Status devDependency Status bitHound Overalll Score

biz-server是一个命令行http server,并包含了一个mock center。

NPM Stat

安装

npm install biz-server -g 

请全局安装biz-server,并使用命令行操作

使用

http server功能

biz-server [path] [options]

or

bs [path] [options]

path:如果没有指定path,那么则认为是当前目录,推荐不指定path,使用当前目录 options:biz-server的http功能是基于https://github.com/indexzero/http-server实现的,能够接受所有http-server的参数

-p Port to use (defaults to 8080)

-a Address to use (defaults to 0.0.0.0)

-d Show directory listings (defaults to 'True')

-i Display autoIndex (defaults to 'True')

--as be filterd ajax request suffix, comma separated (defaults to '.action')

-m or --mock mock config path (defaults to cwd() + /config/mockConfig])

-e or --ext Default file extension if none supplied (defaults to 'html')

-s or --silent Suppress log messages from output

--cors Enable CORS via the Access-Control-Allow-Origin header

-o Open browser window after starting the server

-c Set cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds (defaults to '3600'). To disable caching, use -c-1.

-U or --utc Use UTC time format in log messages.

-P or --proxy Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com

-S or --ssl Enable https.

-C or --cert Path to ssl cert file (default: cert.pem).

-K or --key Path to ssl key file (default: key.pem).

-r or --robots Provide a /robots.txt (whose content defaults to 'User-agent: *\nDisallow: /')

-h or --help Print this list and exit.

-v or --version Print the version.

mock功能

step1:

cd path

进入到希望biz-server运行的目录

step2:

biz-server --init mock

初始化mock功能

step3:

在启动时,增加mock参数,指定mock功能的配置文件

-m your config path  [cwd() + /config/mockConfig]

mock配置文件如下:

{
    "dataSource": ["template", "json"],
    "json": {
	    "path": "/mock/data/",
	    "wrap": false
    },
    "template": {
    	"path": "/mock/template/"
    }
}

mock配置文件请参考biz-mock

https://github.com/yanyu0517/biz-mock#mockconfig

demo

https://github.com/yanyu0517/biz-server/tree/gh-pages