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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-own-bridge

v0.0.3

Published

The missing CLI tool to generate project specific native bridges with a single command

Downloads

18

Readme

react-native-own-bridge

The missing CLI tool to generate project specific native bridges with a single command.

Contributions are welcomed!

Why Do You Need This Tool?

Because scaffolding new native bridges is a TEDIOUS and ERROR-PRONE task!

  • You might forget to add a ; in Obj-C or Java
  • You might forget to import in Obj-C or Java
  • You might need to refer to official doc and then jump back to your editor back and force, then makes some typo...
  • You might need to switch between your JS code editor and XCode / Android Studio back and forth, then again makes more typo...

And we already have some good tools targeting on CREATING A NEW RN BRIDGE LIBRARY, such as:

  • react-native-create-library (https://github.com/frostney/react-native-create-library)
  • react-native-create-bridge (https://github.com/peggyrayzis/react-native-create-bridge)

But..., what if you need to write your OWN PRIVATE NATIVE CODES? For cases such as:

  • Integrating existing native logic
  • Multi-threading stuff
  • Performance optimization
  • Simply not ready / no plan to publish your native stuff as a new open-source library

Anyway, if you're planning to write some native code, we hope this tool can help you!

Supported Platforms

Target platforms

  • Android
  • iOS

Host platforms (the machine running this CLI)

  • Mac
  • Linux

Install

npm i -g react-native-own-bridge
# you might need to add `sudo` for certain platform

Usage

Once installed, in your react-native project root folder:

react-native-own-bridge -n MyAwesomeModule

We'll create following files into corresponding directories for you:

  • MyAwesomeModule.js
  • (ios) MyAwesomeModule.h
  • (ios) MyAwesomeModule.m
  • (android) MyAwesomeModule.java
  • (android) MyAwesomeModulePackage.java

Not only that, we also take care of integrating this new added stuff into your existing code.

  • (ios) AppDelegate.m will be modified to include your new native module
  • (android) MainApplication.java will be modified to include your new native module

You can also see other detail options via react-native-own-bridge --help