Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rproenza86/assemplyscript-demo
Demo to showcase how to use Webassembly with native support for AssemblyScript.
https://github.com/rproenza86/assemplyscript-demo
assemblyscript nodejs npm-package typescript webassembly
Last synced: about 1 month ago
JSON representation
Demo to showcase how to use Webassembly with native support for AssemblyScript.
- Host: GitHub
- URL: https://github.com/rproenza86/assemplyscript-demo
- Owner: rproenza86
- Created: 2020-06-30T12:04:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-30T12:11:31.000Z (over 4 years ago)
- Last Synced: 2024-11-06T03:48:22.639Z (3 months ago)
- Topics: assemblyscript, nodejs, npm-package, typescript, webassembly
- Language: WebAssembly
- Homepage: https://www.npmjs.com/package/@rproenza/assemplyscript-demo
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [@rproenza/assemplyscript-demo](https://www.npmjs.com/package/@rproenza/assemplyscript-demo)
NPM Package to create Webassembly binaries from AssemblyScript applications.
This project was created using the AssemblyScript's [Quick Start](https://www.assemblyscript.org/quick-start.html) guide to create a production ready Package with a decent framework support for development, debugging, building and publishing.
## How to use
### Development experience
#### `npm run asbuild`
Build the application.
#### `npm test`
Launches the test runner and assert the application logic proper execution.
### User experience
#### `npm i @rproenza/assemplyscript-demo`
Install package.
```typescript
import * as WasTest from '@rproenza/assemplyscript-demo';const expressPostEndpointHandler = (request, reply) => {
try {
const { firstNumber, secondNumber } = request.payload;const wasAdditionResult = WasTest.add(firstNumber, secondNumber);
reply.response({ addition: wasAdditionResult });
} catch (error) {
reply(error);
}
};
```Import and use the package on your code.