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

@uruhalushia/sysproxy

v0.2.7

Published

跨平台系统代理设置工具 Node.js 原生绑定

Downloads

1,259

Readme

@uruhalushia/sysproxy

Cross-platform system proxy settings for Node.js, backed by native Rust bindings.

The main package loads a platform-specific optional native package at runtime, so package managers only need to install the binary package matching the current OS, CPU, and libc.

Install

npm install @uruhalushia/sysproxy

Usage

CommonJS:

const {
  queryProxySettings,
  setProxy,
  setPac,
  disableProxy,
  waitProxySettingsChange,
  ProxyGuard,
} = require('@uruhalushia/sysproxy')

ESM:

import sysproxy from '@uruhalushia/sysproxy'

const {
  queryProxySettings,
  setProxy,
  setPac,
  disableProxy,
  waitProxySettingsChange,
  ProxyGuard,
} = sysproxy

Query current proxy settings:

const { queryProxySettings } = require('@uruhalushia/sysproxy')

const config = queryProxySettings()
console.log(config.proxy.enable)

const servers = JSON.parse(config.proxy.servers)
console.log(servers.http_server)

Set HTTP/HTTPS/SOCKS proxy:

const { setProxy } = require('@uruhalushia/sysproxy')

setProxy({
  proxy: '127.0.0.1:7890',
  bypass: 'localhost,127.0.0.0/8',
})

Set PAC proxy:

const { setPac } = require('@uruhalushia/sysproxy')

setPac({ pacUrl: 'http://127.0.0.1:10000/pac' })

Disable proxy:

const { disableProxy } = require('@uruhalushia/sysproxy')

disableProxy()

Wait for one proxy settings change:

const { waitProxySettingsChange } = require('@uruhalushia/sysproxy')

waitProxySettingsChange()
console.log('proxy settings changed')

Guard proxy settings in the Rust layer:

const { ProxyGuard } = require('@uruhalushia/sysproxy')

const guard = new ProxyGuard({
  proxy: '127.0.0.1:7890',
  bypass: 'localhost,127.0.0.0/8',
})

guard.onEvent((event) => {
  console.log(event.kind, event.message)
})

guard.start()

process.on('SIGINT', () => {
  guard.stop()
  process.exit(0)
})

Use PAC guard:

const { ProxyGuard } = require('@uruhalushia/sysproxy')

const guard = new ProxyGuard({
  pacUrl: 'http://127.0.0.1:10000/pac',
})

guard.start()

API

| Function | Description | |----------|-------------| | queryProxySettings(options?) | Return current proxy settings | | setProxy(options?) | Set HTTP/HTTPS/SOCKS proxy | | setPac(options?) | Set PAC proxy | | disableProxy(options?) | Disable proxy | | waitProxySettingsChange(options?) | Block until one system proxy settings change | | new ProxyGuard(options?) | Create a Rust-layer proxy guard with start() / stop() | | ProxyGuard#onEvent(callback) | Receive guard events: changed, restored, restore_failed |

Options

| Field | Type | Description | |-------|------|-------------| | proxy | string | Proxy server, formatted as host:port | | bypass | string | Proxy bypass list, comma-separated | | pacUrl | string | PAC script URL | | device | string | Target network device | | onlyActiveDevice | boolean | Apply only to active network devices | | concurrent | boolean | Enable concurrent apply where supported | | useRegistry | boolean | Windows: use registry-backed settings |