2

How to make npm module(package) of Custom Module(android java) in react native and publish them ?

1 Answer 1

1

Not sure if you are still interested in the answer, but as far as I can see, to create NPM module you simply need to call

npm init 

and proceed with little quiz about your package details OR call

npm init -y

to create module based on package content(if you already have some "index.js" to make "entry point" of your package). Then you need to add all files that should not be published to ".gitignore" file to prevent publishing local files to production. Final step is to call inside package folder:

npm publish 

More information about package create process: https://docs.npmjs.com/getting-started/creating-node-modules

More information about publish process: https://docs.npmjs.com/getting-started/publishing-npm-packages

It is more complicated thing to create Native Module, but as far as you did not asked for this I just leave here a link to my blog post, which explains step-by-step how to create native module and hw to solve typical problems during this topic exploration: http://andengineer.blogspot.com/2016/12/react-native-bridged-android-components.html

Sign up to request clarification or add additional context in comments.

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.