1.0.51 • Published 11 months ago

npm-rn-counter v1.0.51

Weekly downloads
-
License
-
Repository
github
Last release
11 months 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

11 months ago

1.0.18

11 months ago

1.0.22

11 months ago

1.0.21

11 months ago

1.0.20

11 months ago

1.0.26

11 months ago

1.0.24

11 months ago

1.0.23

11 months ago

1.0.29

11 months ago

1.0.28

11 months ago

1.0.27

11 months ago

1.0.33

11 months ago

1.0.32

11 months ago

1.0.31

11 months ago

1.0.30

11 months ago

1.0.37

11 months ago

1.0.36

11 months ago

1.0.35

11 months ago

1.0.34

11 months ago

1.0.39

11 months ago

1.0.38

11 months ago

1.0.40

11 months ago

1.0.44

11 months ago

1.0.43

11 months ago

1.0.42

11 months ago

1.0.41

11 months ago

1.0.48

11 months ago

1.0.47

11 months ago

1.0.46

11 months ago

1.0.45

11 months ago

1.0.51

11 months ago

1.0.50

11 months ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago