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

swan-ssr-requester

v2.0.3

Published

一个向 SwanSSR 发请求的工具,支持 CLI 方式或 NPM 依赖的方式引用

Downloads

3

Readme

SSRR (swan ssr requester)

一个向 SwanSSR 发请求的工具,支持 CLI 方式或 NPM 依赖的方式引用。

TL;DR

npm install swan-ssr-requester -g
cat ~/Download/node.log.* | ssrr --ssr 10.12.3.45:8301
wget 10.12.3.45:8301/node.log.2019031806 | ssrr --ssr 10.12.3.45:8301 --qps 10

CLI 使用

使用 NPM 全局安装 swan-ssr-requester 后,就可以使用 ssrr 命令了。ssrr 会通过 Stdin 读取日志,然后使用日志中的内容向 SwanSSR 发送与日志一模一样的请求

详细用法请参考ssrr -h

Node.js 中使用

const app = request('swan-ssr-requester')({
	// 参考源码中的 Config interface 
});
app.on('end', function(err, {startTime, endTime}) {
    console.log(`请求完成,花费 ${endTime - startTime}ms`);
});
app.run();

可用的事件

swan-ssr-requester 继承了 EventEmitter 类,你可以使用.on(eventName, listener).off(eventName, listener)等方法来监听事件。

| 事件名 | 描述 | 参数 | | ---- | ---- | ---- | | run | 当程序开始执行时 | err | | end | 当程序完成所有发送时。有可能是达到 limit 限制,有可能是日志用光了 | err, analysis | | send | 当程序向 SSR 发送请求时 | err, logInfo | | logPicked | 当程序获取到一个可用的日志时 | err, logInfo | | ssrResponse | 当 SSR 响应请求时 | err, body, response |

LICENSE

see ./ANTI-996