From 4bf568f37800c3ba3f089f565aaa74c4cba0099f Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Tue, 11 Apr 2017 21:40:53 +0200 Subject: [PATCH] usage --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index e81d3fc..1113fde 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,21 @@ Required Java Version ---- JWebAssembly requires Java SE 8 or higher. It is tested with Java SE 8 on [travis-ci.org](https://travis-ci.org/i-net-software/jwebassembly). +## Usage +### Exporting functions +To export a function to make it accessible from JavaScript you need add the annotation org.webassembly.annotation.Export + +```java +import org.webassembly.annotation.Export; + +@Export +public static int add( int a, int b ) { + return a + b; +} +``` + +### Java Limits +In version 1 of WebAssembly you can compile only: +* static methods +* use the data types int, long float and double