npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-helloworld

v0.0.3

Published

Boilerplate for React Native components with native code.

Readme

9-project-layout

This is a boilerplate for distributable React Native components with native code (iOS & Android). It has unit tests for native code, and integration tests for automated testing on emulators or devices. The boilerplate contains a simple HelloWorld component that is backed by native code.

When published and installed via npm, the resulting package supports automatic linking of the native code. You can install and link the HelloWorld component like this:

npm install react-native-helloworld
react-native link react-native-helloworld

Explanation

For a full explanation of the layout, see this article.

There are 3 sets of 3 projects (JS, Obj-C & Java). The first set is for the component code:

/
/android
/ios

The second set is for unit- and integration tests:

/tests
/tests/android
/tests/ios

The third set is just a sample project to demonstrate usage of the components. The Android and iOS parts are just the standard React Native boilerplate:

/example
/example/android
/example/ios

Development

For development of the component code, first run npm install in the tests-folder. Since the native code is linked directly in the test-projects, they serve as a context you can develop it in (the root projects only link React/Native as peer dependencies).

iOS

If you open /tests/ios/HelloWorldTests.xcodeproj in XCode, you can edit the native code and unit tests side-by-side. You'll find the native code under Libraries/HelloWorld.xcodeproj. Unit- and integration tests can be run together in the standard test-runner with ⌘+U.

Android

Open /tests/android in Android Studio, and you'll find both the native code and the unit tests in the project view. The unit tests can be run by right-clicking the package containing the tests, and choosing Run Tests in tests.

There is not yet an automatic test runner for integration tests on Android, but you can run them by firing up /tests as a normal React Native app on an Android emulator or device, and selecting the tests manually from a list.

JS-code

To develop the JS-components and the integration tests, just open /tests in your editor of choice (f.ex. Atom or WebStorm). The /tests/symlinks-folder links in the code from the root projects for convenience. Integration tests are located under /tests/integration-test.

There is a script /tests/make-copies.sh that copies the JS-code from the root project into a folder /tests/copies. This is because the React Native packager doesn't follow symlinks. When running the integration tests through XCode, this script is run automatically.

Since this project aims to demonstrate native code bundling, we haven't included any unit-tests for the JS components. But if you add Jest-tests, they're automatically excluded from the npm bundle.

Example code

The /example folder contains a React Native app that demonstrates usage of your components. Ideally, you only touch the JS-code, and leave the React Native boilerplate as it is.

To run it, first do an npm install from the /example folder, then react-native link. For iOS simulators or Android, you can run react-native run-ios or react-native run-android from the same folder.

To run on an iOS device, open the /example/ios/HelloWorldExample.xcodeproj in XCode, select a development team for code signing (under the General tab of each target in the project settings), and hit ⌘+R.

Publishing

Once you have finished your components, you can run a normal npm publish from the root folder. The /tests and /example folders are automatically excluded from the package.

Once installed and linked in a project, your components can easily be imported:

import HelloWorld from 'react-native-helloworld';

function MyComponent() {
  return <HelloWorld />; 
}