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

v2pac

v1.0.4

Published

Simple configuration of v2rayX's pac configuration file

Downloads

3

Readme

v2pac

一个命令行工具。用户可以直接使用命令行工具添加 v2RayX 的 pac 配置站点,不再需要用户找到 pac 配置文件手动配置,简化操作。

使用环境:

  1. macOS
  2. 使用 v2Ray X
  3. Node.js >= 12

安装

npm install -g v2pac

使用

  1. 初始化 pac 配置文件(只有第一次需要使用)
v2pac init
  1. 添加 url
v2pac add google.com
  1. 一次添加多个 url
v2pac add google.com youtube.com baidu.com

深入

v2pac 是如何工作的?

v2rayX 的配置文件大致如下:

var V2Ray = "SOCKS5 127.0.0.1:1081; SOCKS 127.0.0.1:1081; DIRECT;";

var domains = [
  // ....
];

function FindProxyForURL(url, host) {
  for (var i = domains.length - 1; i >= 0; i--) {
    if (dnsDomainIs(host, domains[i])) {
      return V2Ray;
    }
  }
  return "DIRECT";
}

如果你需要让某一个域名走代理,那么你只需要在 domains 数组中填写域名即可。因此,v2pac 的原理就是帮你添加对应的域名到 domains 数组中。

v2pac 会找到 v2rayX 的 Pac 配置文件,并且在文件的 // mine 字符串之后添加你在终端中输入的 url。

为什么要初始化?

v2pac 添加功能是通过在字符串 // mine 后面添加 url 实现的。而 v2RayX 的 pac 配置文件并没有 // mine 字符串。

因此,执行初始化命令会在 pac 配置文件的第五行添加 // mine

实际上,你可以不使用 init 命令,手动的在 pac 配置文件中添加 // mine 。这样 v2pac 在添加新的 url 的时候,就会将 url 放置在 // mine 后。