7.0.0 • Published 12 months ago

as-console v7.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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

1.0.2

12 months ago

1.0.1

12 months ago

7.0.0

12 months ago

6.0.2

4 years ago

6.0.1

4 years ago

6.0.0

4 years ago

5.0.3

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.0.4

4 years ago

4.0.3

4 years ago

4.0.1

4 years ago

4.0.2

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago