Skip to content

Commit c11f505

Browse files
committed
README: don't use a bitcoin namespace for other deps
1 parent 2047567 commit c11f505

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,27 @@ These steps are advisory only and allow you to use the API to its full extent.
5656

5757
[Browserify](https://github.com/substack/node-browserify) is assumed to be installed for these steps.
5858

59-
From your repository, create a `bitcoin.js` file
59+
From your repository, create a `foobar.js` file
6060

6161
``` javascript
62-
var bitcoin = {
62+
var foobar = {
6363
base58: require('bs58'),
64+
bitcoin: require('bitcoinjs-lib'),
6465
ecurve: require('ecurve'),
6566
BigInteger: require('bigi'),
6667
Buffer: require('buffer')
6768
}
6869

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
7371
```
7472

75-
Then, using browserify, compile `bitcoin.js` for use in the browser:
73+
Then, using browserify, compile `foobar.js` for use in the browser:
7674

77-
$ browserify bitcoin.js -s bitcoin > dist/bitcoin.js
75+
$ browserify foobar.js -s foobar > dist/foobar.js
7876

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.
8078

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.
8280

8381

8482
## Examples

0 commit comments

Comments
 (0)