Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #421 from Mithgol/readme-browser-script
Browse files Browse the repository at this point in the history
update the `script` tag in an example provided by `README.md`
  • Loading branch information
daviddias authored Aug 18, 2016
2 parents 17a0736 + b8c8ba7 commit 0cb3490
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,27 @@ The CLI is available by using the command `jsipfs` in your terminal. This is ali

The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust the asset management process.

```js
var ipfs = require('ipfs');
```

### Use in a browser using a script tag

Simply include ipfs in your bundled javascript file.
Loading this module in a browser (using a `<script>` tag) makes the `Ipfs` object available in the global namespace.

```html
<script type="text/javascript" src="assets/bundled.js"></script>
```
The last published version of the package become [available for download](https://npmcdn.com/ipfs/dist/) from [npmcdn](https://npmcdn.com/) and thus you may use it as the source:

* loading the minified version

```html
<script src="https://npmcdn.com/ipfs/dist/index.min.js"></script>
```

* loading the human-readable (not minified) version

```html
<script src="https://npmcdn.com/ipfs/dist/index.js"></script>
```

## Usage

Expand Down

0 comments on commit 0cb3490

Please sign in to comment.