From c11f50542ee86e2f5805fbf72f0ee3ba6e3a237b Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 5 Jan 2015 13:02:58 +1100 Subject: [PATCH] README: don't use a bitcoin namespace for other deps --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3c53f50..7eb776b 100644 --- a/README.md +++ b/README.md @@ -56,29 +56,27 @@ These steps are advisory only and allow you to use the API to its full extent. [Browserify](https://github.com/substack/node-browserify) is assumed to be installed for these steps. -From your repository, create a `bitcoin.js` file +From your repository, create a `foobar.js` file ``` javascript -var bitcoin = { +var foobar = { base58: require('bs58'), + bitcoin: require('bitcoinjs-lib'), ecurve: require('ecurve'), BigInteger: require('bigi'), Buffer: require('buffer') } -var bitcoinjs = require('bitcoinjs-lib') -for (var a in bitcoinjs) bitcoin[a] = bitcoinjs[a] - -module.exports = bitcoin +module.exports = foobar ``` -Then, using browserify, compile `bitcoin.js` for use in the browser: +Then, using browserify, compile `foobar.js` for use in the browser: - $ browserify bitcoin.js -s bitcoin > dist/bitcoin.js + $ browserify foobar.js -s foobar > dist/foobar.js -You will then be able to load `dist/bitcoin.js` into your browser, with each of the dependencies above accessible from the global `bitcoin` object. +You will then be able to load `dist/foobar.js` into your browser, with each of the dependencies above accessible from the global `foobar` object. -**NOTE**: See the package.json for the currently supported version of browserify used by this repository. +**NOTE**: See our package.json for the currently supported version of browserify used by this repository. ## Examples