1

I am developing a React Native App and have been benefitting from lots of different npm packages for RN.

But for some of the packages, I would like to undergo minor fixes just in order to customize for my own project.

I have done so and fixed the code previously inside the node_modules directory. But this seems to be a stupid way of solving things, because you often have to reinstall many of the packages and the custom code I've written would just be gone.

How can I fix an existing package and use it in my own project? Do I have to fork the repository and adjust the code, then publish it myself as another new npm package?

1
  • Yes. Or submit a pull request to the original project and wait for it to get merged and published. Commented Apr 23, 2018 at 8:24

2 Answers 2

1

The best solution fork it from GitHub and make your changes. then you can add npm module using this command

npm install https://github.com/<username>/<repository>/master
Sign up to request clarification or add additional context in comments.

Comments

0

Either submit a PR and wait for a newer version to be release else Fork and modify the package on github. Then simply include your git project as a dependencies to package.json. Kindly refer to this link for the syntax.

Sample:

"dependencies": {
  "express": "expressjs/express",
  "module": "user/repo#feature\/branch"
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.