6.0.2 • Published 3 years ago

as-console v6.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

AS-Console

Console for AssemblyScript

Installation

~ npm install as-console

Features

  • WASI Implementation
  • JS Bindings
  • NodeJS support
  • Browser support
  • Lunatic support
  • Wasmtime support

Requirements

WASI

  • WASI-enabled runtime

Bindings

  • AssemblyScript Loader/ASbind
  • --exportRuntime flag

Usage (WASI)

import { console } from 'as-console/wasi'

console.log('Hello From AssemblyScript!')
// -- Strings
console.log(1234567890)
// -- Numbers
console.log(new Uint8Array(5))
// -- UintArray
console.log(new Map<string, string>().set('Hello', 'World'))
// -- Map

Usage (Bindings)

JS/Node

...
const loader = require('@assemblyscript/loader')
+ const ConsoleImport = require('as-console/imports')
+ const Console = new ConsoleImport()
const imports = {
+     ...Console.wasmImports
}
const wasmModule = loader.instantiateSync(..., imports);
+ Console.wasmExports = wasmModule.exports
...

AssemblyScript

import { console } from 'as-console'

console.log('Hello From AssemblyScript!')
// -- Strings
console.log(1234567890)
// -- Numbers
console.log(new Uint8Array(5))
// -- UintArray
console.log(new Map<string, string>().set('Hello', 'World'))
// -- Map
6.0.2

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

5.0.3

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

4.0.1

3 years ago

4.0.2

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago