Skip to content

A demo project which shows you how to use AssemblyScript with TypeScript

Notifications You must be signed in to change notification settings

dorin131/assemblyscript-in-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A demo project which shows you how to use AssemblyScript with TypeScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published