as-console
v7.0.0
Published
JavaScript style console for AssemblyScript. Pretty printing, structuring, and more.
Downloads
1,992
Readme
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: [email protected]
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