Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ECMAScript Modules import and export #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ Decode ogg files in the browser using vorbis tools' oggdec via emscripten.
Build it from scratch by just downloading the Makefile and pre.js, run make, and then:

```
import module from "./oggdec"
const Module = module()
const decodeOggData = Module.decodeOggData
const decodedData = decodeOggData([...some array buffer...])
<script type="module">
import {decodeOggDecModule} from "./oggdec.js";
const {decodeOggData} = decodeOggDecModule();
const decodedData = decodeOggData([...some array buffer...]);
</script>
```

(Compiles on Mac, not tested on Linux)
3 changes: 2 additions & 1 deletion oggdec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.