Skip to content

Commit

Permalink
docs: rephrasing of some README.md sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Mar 1, 2018
1 parent 940fcfe commit 99f3400
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ To expedite the process of extracting the assets files, instead of parsing the a

#### Node Modules

Node modules can be added to the project using `npm` inside `nodejs-assets/nodejs-project/`, as long as there's a `package.json` already present.
Node modules can be added to the project using `npm install` inside `nodejs-assets/nodejs-project/`, as long as there's a `package.json` already present.

#### Native Modules

On Linux and macOS, there is experimental support for building modules that contain native code.

The plugin automatically detects native modules inside your `nodejs-project` folder by searching for `.gyp` files. It's recommended to have the build prerequisites mentioned in `nodejs-mobile` for [Android](https://github.com/janeasystems/nodejs-mobile#prerequisites-to-build-the-android-library-on-linux-ubuntudebian) and [iOS](https://github.com/janeasystems/nodejs-mobile#prerequisites-to-build-the-ios-framework-library-on-macos). For Android it's also recommended that you set the `ANDROID_NDK_HOME` environment variable in your system.

Building native modules can take a long time for Android, since it depends on building a standalone NDK toolchain for each required architecture. The resulting `.node` binaries are then included in the final application in a separate asset path for each architecture and the correct one will be chosen at runtime.
Building native modules for Android can take a long time, since it depends on building a standalone NDK toolchain for each required architecture. The resulting `.node` binaries are then included in the final application in a separate asset path for each architecture and the correct one will be chosen at runtime.

While the plugin tries to detect automatically the presence of native modules, there's a way to override this detection and turn the native modules build process on or off, by creating the `nodejs-assets/BUILD_NATIVE_MODULES.txt` and setting its contents to `1` or `0`, respectively. This can be used to start your application like this:
```sh
Expand Down Expand Up @@ -93,7 +93,7 @@ Then add this to your Application's main component's `componentWillMount` lifecy
(msg) => {
alert("From node: " + msg);
},
this
this
);
}
```
Expand Down

0 comments on commit 99f3400

Please sign in to comment.