Socket
Book a DemoInstallSign in
Socket

as-console

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-console

JavaScript style console for AssemblyScript. Pretty printing, structuring, and more.

latest
Source
npmnpm
Version
7.0.0
Version published
Maintainers
0
Created
Source
 _____  _____       _____  _____  _____  _____  _____  __     _____ 
|  _  ||   __| ___ |     ||     ||   | ||   __||     ||  |   |   __|
|     ||__   ||___||   --||  |  || | | ||__   ||  |  ||  |__ |   __|
|__|__||_____|     |_____||_____||_|___||_____||_____||_____||_____|
v7.0.0

Inspiration

AssemblyScript's implementation of console.log only accepts a string. As a result, you can only log string.

// 😢
const foo = 3.14;
console.log(foo);

> ERROR: f64 not assignable to string. Must call .toString()!

This library fixes that

// 😊
const foo = 3.14;
console.log(foo);
// 3.14

Not only can you log primitive types, but it also supports

  • String
  • Integers
  • Floats
  • Booleans
  • Null
  • Map
  • Set
  • Array

Installation

npm install as-console

Usage

import * as console from "as-console";

console.log("Hello from AssemblyScript!");
console.log([
    "It supports other types"
]);
console.log([["Other","than","strings"]]);

const set = new Set<string[]>();
set.add(["and complex types"]);
console.log(set);

Contact

Contact me at:

Email: me@jairus.dev

GitHub: JairusSW

Discord: jairussw

Issues

Please submit an issue to https://github.com/JairusSW/as-console/issues if you find anything wrong with this library

Keywords

assemblyscript

FAQs

Package last updated on 30 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts