Files
Victor Adossi d70b4d4472 feat(examples): add documentation and walkthroughs for examples (#514)
* feat(examples): add documentation and walkthroughs for examples

This commit adds documentation along with walkthroughs for how to use
`jco` when building and deploying WebAssembly components.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>

* refactor(ci): use the all target for examples

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>

* chore(ci): run examples on every push to main

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>

---------

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Co-authored-by: Guy Bedford <gbedford@fastly.com>
2024-11-01 15:47:25 -07:00

21 lines
505 B
JavaScript

/**
* This module is the JS implementation of the `reverser` WIT world
*/
/**
* The Javascript export below represents the export of the `reverse` interface,
* which which contains `reverse-string` as it's primary exported function.
*/
export const reverse = {
/**
* This Javascript will be interpreted by `jco` and turned into a
* WebAssembly binary with a single export (this `reverse` function).
*/
reverseString(s) {
return s.split("")
.reverse()
.join("");
}
};