@@ -56,29 +56,27 @@ These steps are advisory only and allow you to use the API to its full extent.
56
56
57
57
[ Browserify] ( https://github.com/substack/node-browserify ) is assumed to be installed for these steps.
58
58
59
- From your repository, create a ` bitcoin .js` file
59
+ From your repository, create a ` foobar .js` file
60
60
61
61
``` javascript
62
- var bitcoin = {
62
+ var foobar = {
63
63
base58: require (' bs58' ),
64
+ bitcoin: require (' bitcoinjs-lib' ),
64
65
ecurve: require (' ecurve' ),
65
66
BigInteger: require (' bigi' ),
66
67
Buffer: require (' buffer' )
67
68
}
68
69
69
- var bitcoinjs = require (' bitcoinjs-lib' )
70
- for (var a in bitcoinjs) bitcoin[a] = bitcoinjs[a]
71
-
72
- module .exports = bitcoin
70
+ module .exports = foobar
73
71
```
74
72
75
- Then, using browserify, compile ` bitcoin .js` for use in the browser:
73
+ Then, using browserify, compile ` foobar .js` for use in the browser:
76
74
77
- $ browserify bitcoin .js -s bitcoin > dist/bitcoin .js
75
+ $ browserify foobar .js -s foobar > dist/foobar .js
78
76
79
- 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.
77
+ 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.
80
78
81
- ** NOTE** : See the package.json for the currently supported version of browserify used by this repository.
79
+ ** NOTE** : See our package.json for the currently supported version of browserify used by this repository.
82
80
83
81
84
82
## Examples
0 commit comments