y-console

This is a simplified version of min-log with log.setOutputer('browser_html') setup (But slightly different)

Usage no npm install needed!

<script type="module">
  import yConsole from 'https://cdn.skypack.dev/y-console';
</script>

README

yLog

This is a simplified version of min-log with log.setOutputer('browser_html') setup (But slightly different)

Targeting ancient IE (6+) and desktop webview.

screenShot

Installation

npm i -D y-console
# or
yarn add -D y-console

Usage

import log from "y-console";
log.log("This works");
// or
import "y-console";
console.log("This also works");

If no bundling tool (webpack, parcel etc) is available for your workflow, just include this to the your html file, and use console.log as usual.

API

log

Interface

log.log = (input: string, safeMode: boolean = false) => void

Usage

log.log("string");
log.log("string", true);

If set safeMode to true, then we will make sure the container (<div />) of the log exists, or one will be created.

id

The id property of the log container

<div id="id"></div>