Giter Club home page Giter Club logo

rn-nodeify's Introduction

rn-nodeify

Run after npm install and you can use node core modules and npm modules that use them in your React Native app.

Usage

rn-nodeify <options>

Options

--install     install node core shims (default: install all), fix the "browser" 
              (later "react-native") fields in the package.json's of dependencies
--hack        hack individual packages that are known to make the React Native packager choke

Examples

# install all shims and run package-specific hacks
rn-nodeify --install --hack
# install specific shims
rn-nodeify --install "fs,dgram,process,path,console"
# install specific shims and hack
rn-nodeify --install "fs,dgram,process,path,console" --hack

It is recommended to add this command to the "postinstall" script in your project's package.json

"scripts": {
  "start": "node node_modules/react-native/local-cli/cli.js start",
  "postinstall": "rn-nodeify --install fs,dgram,process,path,console --hack"
}

Please note...

  • rn-nodeify won't work with modules that are added using npm link.
  • modules that contain a .babelrc will cause problems with the latest react-native version (0.20 at this time), remove them after installation (rm node_modules/*/.babelrc)
  • when installing a package from git, the postinstall hook isn't triggered, run it manually instead (npm run postinstall)
  • restart the react-native packager after installing a module!
  • removing the packager cache helps as well sometimes (rm -fr $TMPDIR/react-*)

Also, see this example React Native app

rn-nodeify's People

Contributors

mvayngrib avatar vespakoen avatar secretmapper avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.