@@ -52,16 +52,33 @@ From the repo:
5252
5353### Browser
5454
55- From the repository: Compile ` bitcoinjs-min.js ` with the following command:
55+ If your are familiar with how to use browserify, ignore this and proceed normally.
56+ These steps are advisory only and allow you to use the ` bitcoinjs-lib ` to its full extent.
5657
57- $ npm run-script compile
58+ [ Browserify ] ( https://github.com/substack/node-browserify ) is assumed to be installed for these steps.
5859
59- From NPM:
6060
61- $ npm -g install bitcoinjs-lib browserify uglify-js
62- $ browserify -r bitcoinjs-lib -s bitcoin | uglifyjs > bitcoinjs.min.js
61+ From your repository, create a ` bundle.js ` file
6362
64- After loading this file in your browser, you will be able to use the global ` bitcoin ` object.
63+ ``` javascript
64+ var bitcoin = {
65+ base58: require (' bs58' ),
66+ ecurve: require (' ecurve' ),
67+ BigInteger: require (' bigi' ),
68+ Buffer: require (' buffer' )
69+ }
70+
71+ var bitcoinjs = require (' bitcoinjs-lib' )
72+ for (var a in bitcoinjs) bitcoin[a] = bitcoinjs[a]
73+
74+ module .exports = bitcoin
75+ ```
76+
77+ Then, using browserify, compile the bundle for use in the browser:
78+
79+ $ browserify bitcoin.js -s bitcoin > dist/bitcoin.js
80+
81+ 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.
6582
6683
6784## Usage
0 commit comments