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

replacer-cli

v1.6.1

Published

a tool for reaplace all network resources to local

Downloads

36

Readme

🐳 replacer-cli

NPM Download NPM Version NPM License PRs Welcome

🔨 网络资源本地化工具 - 当部署环境为内网时,网络资源访问不了的时候,帮助你将网络资源本地化,而无需手动替换!

目录

注意事项

环境需求

Node.js 8.x

使用教程

快速开始

npm i replacer-cli -g 

# 安装完毕后可以使用 rep 运行

帮助

#bash
rep -h

Usage: rep [options] [command]

Options:
  -v, --version          output the version number
  -h, --help             output usage information

Commands:
  replace [dist]         替换指定目录的网络资源为静态资源
  proxy [target] [port]  启动静态资源服务器,并代理到指定的地址 proxy http://www.baidu.com 80 指的是请求代理到 target 启动的服务使用 80 端口
  init                   快速初始化你的仓库为镜像仓库

⬆ Back to Top

参数选项

rep replace [dist] [public_path]

public_path 默认为 /, 如果你的项目部署的时候需要多一层路径,则提供第二个参数

运行此命令会将 distDir 目录下的所有网络资源替换成本地资源

例子

case 1: rep replace dist

case 2: rep replace dist /public_path

before

image

after

image

rep proxy [target] [port]

本地资源替换成功后可以使用此命令查看是否还有网络资源在,相当于本地测试!target 是目标代理地址, port 非必填

例子

rep proxy http://127.0.0.1:9999

⬆ Back to Top

rep init

快速添加前端镜像化所需文件到项目中

例子

rep init

image

⬆ Back to Top

rep config [port]

本地拉起服务,快速的生成 auth_build.sh 文件内容, port 为端口号。

例子

rep config 9999

⬆ Back to Top

TODO

  • 快速添加给项目 .gitignore
  • 快速添加 eslint

⬆ Back to Top