have-it icon indicating copy to clipboard operation
have-it copied to clipboard

Possible to run against package.json

Open AutoSponge opened this issue 7 years ago • 3 comments

Here's the scenario:

I have a folder containing App. App needs a hotfix and a build but (for whatever reason) I can't simply jump branches. I need to do a clone/copy in another folder. I know the packages haven't changed, so the fastest thing to do iscp node_modules from /App to /App-hotfix. However, if have-it could read the package.json in /App-hotifx, I wouldn't need to copy.

EDIT: I think in this case I don't want to simply link the node_modules folders because I may need to add a package to enable "hotfix".

AutoSponge avatar Apr 10 '17 17:04 AutoSponge

and that would be different from npm i ../<local folder> ?

bahmutov avatar Apr 10 '17 18:04 bahmutov

@bahmutov, If have i could run against package.json and pull the packages I need from the "sister" project folder, I could "install" much faster than npm i but npm still provides the fallback for not found cases.

If I misunderstood the purpose of have-it, I apologize. Daily, I work on a corporate network that breaks ssl to inspect EVERY dl for viruses which makes npm i on a large project something that takes quite a while.

AutoSponge avatar Apr 10 '17 23:04 AutoSponge

Hmm, so we can make a "proxy" fake local package in "node_modules" that points at "sister" project, in which case it should work. This probably would need to be a command something like have <sister folder path>

for you now, what if you do npm i <sister project> --min-cache 9999999 option? that should not fetch deps again and again

bahmutov avatar Apr 12 '17 12:04 bahmutov