Vikram Singh Shekhawat
Vikram Singh Shekhawat

Reputation: 764

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

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

Upvotes: 2

Views: 628

Answers (1)

evasyuk
evasyuk

Reputation: 383

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

Upvotes: 1

Related Questions