Skip to content

Commit

Permalink
Add an example of using the ES module to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpblog committed Sep 6, 2018
1 parent d4fe9c1 commit c0f3cf6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ page()
* [cdnjs](https://cdnjs.com/libraries/page.js)
* [unpkg](https://unpkg.com/page/page.js)

Example usage is:
Using with global script tags:

```html
<script src="https://unpkg.com/page/page.js"></script>
Expand All @@ -43,6 +43,16 @@ page()
</script>
```

Or with modules, in modern browsers:

```html
<script type="module">
import page from "//unpkg.com/page/page.mjs";
page('/home', () => { ... });
</script>
```

## Running examples

To run examples do the following to install dev dependencies and run the example server:
Expand Down

0 comments on commit c0f3cf6

Please sign in to comment.