Skip to content

Instantly share code, notes, and snippets.

@dharavp
Created February 7, 2019 12:55
Show Gist options
  • Save dharavp/541642173bcf12b86f869be944e6af3f to your computer and use it in GitHub Desktop.
Save dharavp/541642173bcf12b86f869be944e6af3f to your computer and use it in GitHub Desktop.
1. create your file index.js or create project
2. create package.json file
add this content
{
"name": "react-native-demo", //add your package name
"version": "1.0.2",
"description": "React-native project structure",
"main": "index.js",
"author": "xyz prr <abc@gmail.com>", // your name <email>
"license": "MIT",
"peerDependencies": {
"react": ">= 15.x",
"react-native": ">= 0.47.x"
}
}
3. do npm install in you project folder
4. do npm login
add username password
5. add project on github
6. do npm init
add packagename, keywords, testcommand, and all things
7. do npm publish
and your package is ready
now you can use it any where using npm install --save your-package-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment