Skip to content

Commit

Permalink
example updates
Browse files Browse the repository at this point in the history
  • Loading branch information
UmamiAppearance committed Dec 9, 2022
1 parent d031e63 commit 46b34ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ ecoji.encode("Hello World!");
// result: 🏯🔩🚗🌷🍉👇🦒🪁👡📢☕

// default output is an ArrayBuffer, pass 'str' to convert to string
ejoji.decode("🏯🔩🚗🌷🍉👇🦒🪁👡📢☕", "str");
ecoji.decode("🏯🔩🚗🌷🍉👇🦒🪁👡📢☕", "str");
// result: "Hello World!"
```

Expand Down
20 changes: 20 additions & 0 deletions examples/live-examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,26 @@ <h1>BaseEx - Live Examples</h1>
<hr>

<section id="examples">
<article>
<h3>&#9755; Basic example</h3>
<template class="live-example">
<h1>En- and decoding (Ecoji)</h1>

<script data-run="true">
const ecoji = new Ecoji();

const inputString = "Hello World!";
console.log("Input string: ", inputString);

const encoded = ecoji.encode(inputString);
console.log("Encoded string: ", encoded);

const decoded = ecoji.decode("🏯🔩🚗🌷🍉👇🦒🪁👡📢☕", "str");
console.log("Decoded string: ", decoded);
</script>
</template>
</article>

<article>
<h3>&#9755; Encoders handle almost every input</h3>
<template class="live-example">
Expand Down

0 comments on commit 46b34ab

Please sign in to comment.