# react-native-coinhive-miner

> CoinHive cryptocurrency miner for react-native

Latest version **0.0.3** (published 2018-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-coinhive-miner
pnpm add react-native-coinhive-miner
yarn add react-native-coinhive-miner
bun add react-native-coinhive-miner
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-01-18 |
| First published | 2018-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | abgv9221@gmail.com |
| Maintainers | ghondar |
| Keywords | react-native, coinhive, miner, cryptonight, monero, android, ios |

## Links

- npm: https://www.npmjs.com/package/react-native-coinhive-miner
- Repository: https://github.com/ghondar/react-native-coinhive-miner
- Homepage: https://github.com/ghondar/react-native-coinhive-miner#readme
- Issues: https://github.com/ghondar/react-native-coinhive-miner/issues
- npm.io page: https://npm.io/package/react-native-coinhive-miner

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2018-01-18
- 0.0.2 — 2018-01-14
- 0.0.1 — 2018-01-05

## README

# react-native-coinhive-miner

#### Install via npm

`npm i react-native-coinhive-miner --save`

#### Usage

```Javascript
import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View,
  TouchableHighlight
} from 'react-native';

import CoinHiveClient from 'react-native-coinhive-miner'

export default class App extends Component<{}> {
  state = {
    speed: 100
  }

  onPress() {
    this.setState({
      speed: 90
    })
  }

  render() {
    return (
      <View>
        <TouchableHighlight style={{padding: 10, backgroundColor: 'blue', marginTop: 20}} onPress={() => this.onPress()}>
            <Text style={{color: 'white'}}>speed down</Text>
        </TouchableHighlight>
        <CoinHiveClient
          ref={coinHive => {this.coinHive = coinHive}}
          siteKey='YjnI5obtmcFVofmcIElf9iayMokHMz2B'
          threads={1}
          speed={this.state.speed}
          onSpeed={(speed) => { console.log(speed) }}
          onThreads={(threads) => { console.log(threads) }}
          ...
        />
      </View>
    );
  }
}
```

## API

### Props
* `siteKey`  - String
* `threads`  - Number
* `speed`    - Number (10 - 100),


### Ref Function
* `stopNow`         - Inmediate stop
* `stop()`          - stop mining
* `addThread()`     - add 1 thread
* `removeThread()`  - remove 1 thread
* `speedUp()`       - add 10% to speed
* `speedDown()`     - remove 10% to speed

### Events
* `onStats`  - Event Function
* `onStop`   - Event Function
* `onRunning`- Event Function
* `onStart`  - Event Function
* `onSpeed`  - Event Function
* `onThreads`- Event Function
* `onInit`   - Event Function
* `onStart`  - Event Function
* `onStop`   - Event Function

#### LICENSE
MIT

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