Nobody's Perfect, Man

    as-console
    TypeScript icon, indicating that this package has built-in type declarations

    6.0.2 • Public • Published

    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

    Install

    npm i as-console

    DownloadsWeekly Downloads

    30

    Version

    6.0.2

    License

    MIT

    Unpacked Size

    17.2 kB

    Total Files

    18

    Last publish

    Collaborators

    • slicewire-dev