1.0.51 • Published 2 years ago

npm-rn-counter v1.0.51

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Create an NPM package for React Native

An example repo of how to create an NPM package for use in other projects. In this case, React Native.

Steps

  • Create a new project which includes a package.json. In this case we're using expo so we can test then release.

    npx create-expo-app npm-rn-counter
  • Define then export the components, functions, constants we want to expose from our package.

    • This package exports from ./src/lib/Counter.js which exports 1 component, constant, function each.
  • Add necessary keys to package.json to configure npm.

    • Version package "version": "1.0.51".
    • Include the ./src and ./README.md with "files": [].
    • Define entry point for modules in this package "main": "index.js".
    • Info which shows up on the npm.com registry web page "repository": {}.

    Semantic version which we increment each time we want to publish a new version of our package.

    "main": "./src/lib/Counter.js",
    "version": "1.0.51",
    "files": [
        "src",
        "README.md"
    ],
    "repository": {
        "type": "git",
        "url": "git+https://github.com/PrimeTimeTran/npm-counter"
    },
  • Login to NPM from CLI, then publish it.

    npm publish

FAQ

  • Do I have to commit before publishing? No, npm is it's own thing.
  • If expo hangs when importing your package, it might be because of this issue.
1.0.19

2 years ago

1.0.18

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.40

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago