Getting started with AssemblyScript
AssemblyScript runs completely on the Node.js environment, so make sure you have Node installed (ideally on of the latest version, as it has to support WebAssembly). Once you have Node available on your machine, you can get started.
Creating a new project
Section titled “Creating a new project”npm initnpm install --save-dev assemblyscriptnpx asinit .Make sure to install npx before:
npm install -g npxStructure of your project
Section titled “Structure of your project”AssemblyScript generates a bunch of files and directories out of the box.
Within the directory assembly there is your TypeScript code, which will be compiled
to webassembly. Also inside of this directory, there is the file tsconfig.json.
This file is all for configuring TypeScript.
build holds the compiled WebAssembly modules.
Running the module
Section titled “Running the module”npm run asbuild