Skip to content
A demo project which shows you how to use AssemblyScript with TypeScript
WebAssembly TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assembly
build
.gitignore
Readme.md
index.ts
loader.ts
package-lock.json
package.json
tsconfig.json

Readme.md

AssemblyScript in TypeScript

How to reproduce setup

  1. npm init
  2. npm i -S typescript @types/node assemblyscript
  3. npx tsc --init
  4. npx asinit .
  5. In tsconfig.json add
"compilerOptions": {
  "outDir": "./dist",
  "rootDir": "./"
},
"exclude": [
  "node_modules",
  "assembly"
]
  1. In package.json add
"start": "node --experimental-modules --experimental-wasm-modules ./dist/index.js",
"build": "npm run asbuild && tsc -p ./tsconfig.json && npm run copy",
"copy": "rm -rf dist/build/ && cp -r build dist/build/",
  1. Rename index.js to loader.ts, add any missing types and export the webassembly instance to be used from other files

How to run

  1. npm run build
  2. npm start

To read

https://docs.assemblyscript.org/quick-start

https://www.joyent.com/blog/improved-wasm-support-coming-to-node

You can’t perform that action at this time.