as-console

Console implementation for AssemblyScript

Showing:

Popularity

Downloads/wk

38

GitHub Stars

6

Maintenance

Last Commit

2mos ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100