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

whistle.fastest

v0.2.24

Published

whistle plugin for fastest

Downloads

6

Readme

whistle.fastest

whistle.fastest 为 whistle 的一个插件,主要用于 fastest 项目。

特性

whistle.fastest 主要功能点如下:

  • 从远程服务器中获取相关配置,并动态设置到 whistle 规则中,实现转发
  • 将请求的结果在返回之前进行二次处理,以便实现静态资源、CGI 等的替换
  • 支持权限控制

安装使用

whistle 的插件需要安装到全局(详见whistle插件开发文档 ),安装命令如下:

$ npm install whistle.fastest -g

安装成功之后,可以在 whistle 的管理端页面 Plugins tab 页看到安装的插件。

在规则中需要如下配置。将所有的请求都经过它来处理,注意需要传入 fastest 管理端接口的 IP 地址:

whistle.fastest://10.20.30.40 *

开发调试

安装插件

在开发的时候,可以使用下面命令将本地的包软链到全局。

npm link

构建

源代码在 src 目录下,我们引入了 babel 来处理,使用如下命令来构建发布版本:

npm run build

也可使用下面的命令,当 src 目录下的文件有变化时会自动构建

npm run watch

调试插件

开启 whistle 的调试模式,这样可以在控制台看到插件console输出的日志及错误。

w2 stop
w2 run

如果需要自定义端口,则可以使用 w2 run -p 8080

修改插件代码后,需要触发插件项目的 package.json 修改才会重新加载该插件,比如添加或删除一个空格。

测试用例

我们为主要的操作增加了测试用例,运行下面命令可以执行测试用例:

npm test

备注

本扩展插件是在 whistle.script文档 的基础上的简化定制版本。

一开始我们想直接使用 whistle.script ,但是发现请求量大的时候可能会导致 whistle 崩溃,原因未知,可能与其实现上过于复杂导致。

参考文档