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

rapid-replace

v0.1.2

Published

repid replace node modules file

Downloads

9

Readme

Rapid Replace

快速替换 npm 或者 yarn 安装的node module中的一些脚本文件

场景

一般情况下node moudle是项目安装的依赖包,但是有些时候会用到一些依赖项目,这些项目基本上能满足需求,但是有些情况下不能满足需求,就涉及到改动依赖项目的问题。如果是项目bug的话可以提PR给原来的项目,如果涉及一些私有的定制就会比较麻烦。 改动项目有几种方式:

  1. fork 一个项目,改完代码,提交交一个pr 坐等新版本 需要周期很长,时间很难控制
  2. fork一个项目,改完代码自己发布到npm 需要改依赖的项目,不能同步新的版本
  3. 直接替换node modules 对应的文件, Rapid Replace就是这种方式 可以迅速替换需要改的文件,相应的改动跟随项目同步管理

Rapid Replace优缺说明

优点:

  1. 不用提交代码到原项目,周期短
  2. 不用修改项目名称
  3. 每个项目都可以有不同的版本

缺点:

  1. 项目管理起来复杂
  2. 不能跟随原项目升级,或者说升级需要重新验证代码

使用说明

配置

  1. 项目根目录下
.rapid-replace.conf
{
    projects:[
        {
            type:'dir',// 暂时不支持目录配置
            project:'react-native',
            dir:'./rapid-replace/react-native/'
        },
        {
            type:'file',
            project:'react-native',
            files:[
                {
                    origin:'./local-cli/bundle/bundle.js',
                    new:'./rapid-replace/react-native/local-cli/bundle/bundle.js'
                },
                {
                    origin:'./local-cli/bundle/saveAssets.js',
                    new:'./rapid-replace/react-native/local-cli/bundle/saveAssets.js'
                }
            ]
        }
    ]
}
  1. 项目根目录的package.json 文件
rapidReplaceConfig: {
    projects:[
        {
            type:'dir', // 暂时不支持目录配置
            project:'react-native',
            dir:'./rapid-replace/react-native/'
        },
        {
            type:'file',
            project:'react-native',
            files:[
                {
                    origin:'./local-cli/bundle/bundle.js',
                    new:'./rapid-replace/react-native/local-cli/bundle/bundle.js'
                },
                {
                    origin:'./local-cli/bundle/saveAssets.js',
                    new:'./rapid-replace/react-native/local-cli/bundle/saveAssets.js'
                }
            ]
        }
    ]
}

执行时机

在项目安装完成后执行