From a9434f71ec8ae08e9e4771d3f0d387bb9c6af050 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 25 Sep 2017 09:30:53 +1000 Subject: [PATCH] README: add notes about ES5, Node LTS feature tracking --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c153bc1..df3f4b6 100644 --- a/README.md +++ b/README.md @@ -41,41 +41,41 @@ var bitcoin = require('bitcoinjs-lib') ### Browser If you're familiar with how to use browserify, ignore this and proceed normally. -These steps are advisory only, and may not be necessary for your application. +These steps are advisory only, and may not be suitable for your application. [Browserify](https://github.com/substack/node-browserify) is assumed to be installed for these steps. -From your repository, create an `index.js` file +For your project, create an `index.js` file ``` javascript -module.exports = { - base58: require('bs58'), - bitcoin: require('bitcoinjs-lib'), - ecurve: require('ecurve'), - BigInteger: require('bigi') +let bitcoin = require('bitcoinjs-lib') + +// your code here +function myFunction () { + return bitcoin.ECPair.makeRandom().toWIF() } -``` -Install each of the above packages locally -``` bash -npm install bs58 bitcoinjs-lib ecurve bigi +module.exports = { + myFunction +} ``` -After installation, use browserify to compile `index.js` for use in the browser: +Now, to compile for the browser: ``` bash - $ browserify index.js --standalone foo > app.js +browserify index.js --standalone foo > app.js ``` -You will now be able to use `