Skip to content

Commit

Permalink
README: don't use a bitcoin namespace for other deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Feb 5, 2015
1 parent 2047567 commit ce9c614
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

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
Expand Down

0 comments on commit ce9c614

Please sign in to comment.