Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Substitute a package in NPM/Node

Tags:

node.js

npm

Is it possible to force an external npm dependency to use a different node.js package that offers the same API but a different implementation?

like image 641
sparkFinder Avatar asked Jun 29 '26 15:06

sparkFinder


1 Answers

If you're willing to do that and that module is open source you could fork that on github, change their package.json to include the module you want and use github url for your own package.json like this:

"modulename": "git+https://[email protected]/user/repo.git"
like image 121
user1695032 Avatar answered Jul 02 '26 08:07

user1695032