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

npm-proxy-manager

v1.1.14

Published

npm-proxy-manager is a command-line tool for managing npm proxies, providing quick enable and disable proxy functionalities.

Downloads

159

Readme

npm-proxy-manager

npm-proxy-manager 是一个用于管理 npm 代理的命令行工具,它提供快捷的 开启关闭切换 代理等功能。

npm-proxy-manager 以如下方式存储您的自定义代理:

[proxy1]
proxy=http://test/proxy1
https-proxy=http://test/https-proxy1

[proxy2]
proxy=http://test/proxy2
https-proxy=http://test/https-proxy2

通过 np opennp close 命令,你可以方便地开启与关闭代理;

通过 np use 命令(如:np use proxy1),你可以方便地切换代理。

安装

请确保你已经安装了 Node.jsnpm,然后运行以下命令来安装依赖:

npm install -g npm-proxy-manager

Example

添加自定义代理 proxy1

np add proxy1 http://test/proxy1

列出所有已添加的代理

np ls

使用(切换)代理 proxy1

np use proxy1

禁用代理

np close

启用代理(继续使用 proxy1)

np open

使用方法

注意:下述命令中,np 是 npm-proxy 的简写,你也可以书写全称。

添加自定义代理

np add <name> <url>

默认情况下,np add <name> <url> 会将 <name> 下的 http proxy 与 https proxy 同时设置为 <url>,你可以使用 -p 和 -hp 命令仅设置 http proxy 或 https proxy,如下:

仅设置 http proxy

np add <name> -p <url>

仅设置 https proxy

np add <name> -hp <url>

列出所有代理

np ls
or
np list

输出示例:

proxy1 ---- [proxy] http://test/proxy ---- [https-proxy] https://test/https-proxy
proxy2 ---- [proxy] http://test/proxy ---- [https-proxy] https://test/https-proxy

默认情况下,np ls 会把 http proxy 与 https proxy 都列举出来,你可以使用 -p 和 -hp 命令单独列举 http proxy 和 https proxy,如下:

仅列举 http proxy

np ls -p

输出示例:

proxy1 ---- http://test/proxy
proxy2 ---- http://test/proxy

仅列举 https proxy

np ls -hp

输出示例:

proxy1 ---- https://test/https-proxy
proxy2 ---- https://test/https-proxy

使用(切换)代理

通过 np use <name> 命令,你可以在事先配置好的代理间方便地切换。

np use <name>

默认情况下,np use <name> 会同时应用 <name> 下的 http proxy 与 https proxy,你可以使用 -p 和 -hp 命令仅应用 <name> 下的 http proxy 或 https proxy,如下:

仅应用 <name> 下的 http proxy

np use <name> -p

仅应用 <name> 下的 https proxy

np use <name> -hp

关闭代理

np close

默认情况下,np close 会同时关闭 http proxy 与 https proxy,你可以使用 -p 和 -hp 命令仅关闭 http proxy 或 https proxy,如下:

仅关闭 http proxy

np close -p

仅关闭 https proxy

np close -hp

开启代理

np open

默认情况下,np open 会同时开启 http proxy 与 https proxy,你可以使用 -p 和 -hp 命令仅开启 http proxy 或 https proxy,如下:

仅开启 http proxy

np open -p

仅开启 https proxy

np open -hp

删除代理

np del <name>
or
np delete <name>

重命名代理

np rename <name> <newName>

设置代理的 URL

np set <name> <url>

默认情况下,np set <name> <url> 会将 <name> 下的 http proxy 与 https proxy 同时设置为 url,你可以使用 -p 和 -hp 命令仅设置 http proxy 或 https proxy,如下:

仅设置 http proxy

np set <name> -p <url>

仅设置 https proxy

np set <name> -hp <url>

列出当前正在使用的代理

np cur
or
np current

默认情况下,np cur 会同时列举当前正在使用的 http proxy 与 https proxy,你可以使用 -p 和 -hp 命令仅列举 http proxy 或 https proxy,如下:

仅列举当前正在使用的 http proxy

np cur -p

仅列举当前正在使用的 https proxy

np cur -hp

许可证

MIT