# react-native-module-check

> Helps React Native NativeModule creators detect bad installations and provide useful instructions.

Latest version **2.6.2** (published 2017-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-module-check
pnpm add react-native-module-check
yarn add react-native-module-check
bun add react-native-module-check
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.6.2 |
| Published | 2017-09-03 |
| First published | 2017-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mark Miyashita |
| Maintainers | negativetwelve |
| Keywords | dx, module, native, react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-module-check
- Repository: https://github.com/negativetwelve/react-native-package/tree/master/packages/react-native-module-check
- Homepage: https://github.com/negativetwelve/react-native-package
- npm.io page: https://npm.io/package/react-native-module-check

## Dependencies (2)

- [warning](https://npm.io/package/warning.md) ^3.0.0
- [invariant](https://npm.io/package/invariant.md) ^2.2.2

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 2.6.2 (latest) — 2017-09-03
- 2.6.1 — 2017-08-31
- 2.6.0 — 2017-08-27
- 2.5.0 — 2017-08-23
- 2.3.0 — 2017-08-22
- 2.2.0 — 2017-08-22
- 2.1.0 — 2017-08-17
- 2.0.0 — 2017-08-16
- 1.7.0 — 2017-08-15
- 1.6.0 — 2017-08-14
- 1.5.0 — 2017-08-14
- 1.4.0 — 2017-08-14
- 1.3.0 — 2017-08-14
- 1.2.3 — 2017-08-14
- 1.2.2 — 2017-08-14
- … 3 more at https://npm.io/package/react-native-module-check/versions

## README

# react-native-module-check

[![npm](https://img.shields.io/npm/v/react-native-module-check.svg)](https://www.npmjs.com/package/react-native-module-check)
[![npm](https://img.shields.io/npm/dt/react-native-module-check.svg)](https://www.npmjs.com/package/react-native-module-check)
[![npm](https://img.shields.io/npm/l/react-native-module-check.svg)](https://github.com/negativetwelve/react-native-package/blob/master/LICENSE)

Checks NativeModules to make sure they are installed correctly. Provides react-native package creators with an easy way to write instructions when things go wrong.

## Getting Started

Install `react-native-module-check` using `yarn`:

```shell
yarn add react-native-module-check
```

## Motivation

When installing a NativeModule for React Native, there are several issues that can go wrong and often times the error messages are cryptic and misleading. This module aims to provide NativeModule authors an easy way to add a default message that should appear either as a `warning` or as an `error` on startup.

This package also allows you to notify users when a NativeModule only supports certain platforms. See the examples below.

## Usage

This is an example from the `react-native-instabug-sdk` which was the motivation for this package. By default, `check` will log a warning using `console.warn` but it also has the option to throw an error by setting `error: true`.

```javascript
import {check} from 'react-native-module-check';

check({
  json: require('../package.json'),
  nativeModule: NativeModules.RNInstabugSDK,
  enabled: Platform.select({
    ios: true,
  });
});
```

Using values from the `package.json`, we can record a consistent warning if we determine this package was not installed correctly:

> Warning: react-native-instabug-sdk was not installed correctly. Please follow the instructions in the README: https://github.com/negativetwelve/react-native-instabug-sdk#readme.

I recommend placing this call at the top of your implementation before you call any methods on your NativeModule.

## Contributing

If you have any ideas on how this module could be better, [create an Issue](https://github.com/negativetwelve/react-native-package/issues) or [submit a PR](https://github.com/negativetwelve/react-native-package/pulls).

---
_Source: https://npm.io/package/react-native-module-check · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
