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

plug-base

v0.9.23

Published

Plug Base for FE-Dev

Downloads

98

Readme

Plug Base

QuickStart

var server = require("plug-base");
// 设置根目录
server.root("src");

// 设置配置文件目录
server.config(".config");

// 设置hosts映射关系(将修改hosts)
server.enableHosts({
  "127.0.0.1": [
    "g.cdn.com",
    "a.cdn.com"
  ]
});

// 不修改hosts
server.disableHosts();

server
  // 普通中间件
  .use([router,] function (req, res, next) {
    ...
    next();
  })
  // 支持启动后传入统一配置的中间件
  .plug(require("flex-combo")[, {...}])
  .plug(require("essi")[, {...}])
  // 收尾处理逻辑
  .end(function (req, res, next) {
    // res.buffer
    // res.error
  })
  .listen([80,] [443,] [function (port) {
    ...
  }]);

new Instance

var PlugBase = require("plug-base").PlugBase;

var server = new PlugBase();

// 获取rootCA文件地址
server.getRootCAPath();

根证书生效

访问http://127.0.0.1/~https,该页面中显示了一个根证书二维码以及根证书下载地址。

Mobile Support

使用移动设备扫描二维码并下载根证书安装于设备中,以支持移动设备调试HTTPs页面。

Firefox Support

Firefox有其自身的根证书信任机制,需要另行导入根证书。 通过点击下载地址或直接访问http://127.0.0.1/~rootCA.crt进行下载并导入Firefox。

HTTPs

HTTPs调试需要异步SNI的支持,如需开启HTTPs服务,请将Node.js升级至0.12.x及以上。

OS Support

Mac OS X, Windows, Linux

Issues & Bugs

Tell me Via limingv5[#]gmail.com