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

asuka

v0.4.1

Published

mini HTTPS proxy

Downloads

4

Readme

asuka

mini HTTPS proxy

简单的 HTTPS 代理服务器,依赖于 node 5.0 及其以上版本

Usage

$ npm install -g asuka

# 启动服务器
$ asuka start

# 停止服务器
$ asuka stop

服务器默认使用 8777 端口并将日志保存在 $HOME/log/asuka 文件夹下

Command

start

启动服务器

Usage: asuka-start [options]

  Options:

    -h, --help           output usage information
    -p, --port [port]    port
    -l, --log [path]     log path
    -c, --config [file]  config file

配置文件为 JSON 文件,可包含以下信息:

  • port {number} 服务器的端口号
  • log {string} 日志路径
  • hosts {Array.<string>} 允许访问的站点列表,如果为空则不限制访问的站点
{
    "port": 8848,
    "log": "/var/log/asuka",
    "hosts": ["registry.npmjs.org"]
}

stop

停止服务器

restart

重启服务器

API

Proxy(options)

创建代理服务器对象

  • options {Object=} 配置信息
    • port {Number=} 代理服务器端口,默认为 8777
    • hosts {Array.<string>=} 允许访问的站点列表(向下包含子域名),如果不设置则不限制访问的站点
import Proxy from 'asuka';

// 设置端口在 8787 并且只能访问 github.com
let proxy = new Proxy({port: 8787, hosts: ['github.com']});

Methods

close()

关闭服务器

reload(options)

重新加载配置信息

  • options {Object=} 配置信息
    • hosts {Array.<string>=} 允许访问的站点列表

Events

access

代理请求访问事件

  • e {Object} 事件参数
    • host {string} 访问站点
    • client {string} 客户端 IP

block

代理请求屏蔽事件

  • e {Object} 事件参数
    • type {string} 屏蔽理由,目前有 host 表示站点白名单限制 不允许访问
    • host {string} 访问站点
    • client {string} 客户端 IP