y-console
v1.0.5
Published
This is a simplified version of [`min-log`](https://github.com/chunpu/min-log) with `log.setOutputer('browser_html')` setup (But slightly different)
Downloads
4
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.
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 useconsole.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>