Skip to content

Commit

Permalink
unpkg support and browser instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
tompahoward committed Oct 30, 2020
1 parent a71a92d commit 7be7d12
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Client library for level 3 RESTful APIs
- [Usage](#usage)
- [Node.js](#nodejs)
- [Browser](#browser)
- [Usage](#usage-1)
- [API Design Notes](#api-design-notes)
- [Get root API](#get-root-api)
- [Get list of operations](#get-list-of-operations)
Expand Down Expand Up @@ -94,16 +93,33 @@ _None_
import { waychaser } from '@mountainpass/waychaser'

...

const api = await waychaser.load(apiUrl);
try {
const api = await waychaser.load(apiUrl);
// do something with `api`
}
catch(error) {
// do something with `error`
}

```

## Browser

_Comming Soon..._
```html
<script type="text/javascript" src="https://unpkg.com/@mountainpass/waychaser@VERSION"></script>

...
<script type="text/javascript">
waychaser.load(apiUrl).then(api => {
// do something with `api`
}).catch(error => {
// do something with `error`
});
</script>
```

# Usage
Where `VERSION` is the version of waychaser you would like to use.

# API Design Notes

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
],
"license": "Apache-2.0",
"main": "dist/waychaser.js",
"unpkg": "dist/waychaser.umd.min.js",
"module": "src/waychaser.js",
"engines": {
"node": ">=10.17.0"
Expand Down

0 comments on commit 7be7d12

Please sign in to comment.