0.1.11 • Published 2 years ago
weirdconsole v0.1.11
This allows you to do some weird and useless in the browser's devtools
Installation
Simply load it from a CDN:
<script src="https://unpkg.com/weirdconsole"></script>
use npm:
npm i weirdconsole
Usage
import 'weirdconsole'
console.npm
This methods help to you install npm packages in the devtools
console.npm('module_name',{
type?: 'module'
})
Import specific version:
console.npm('loadsh@0.0.4')
use URL:
console.npm('https://unpkg.com/loadsh@0.0.4/lodash.js')
🌰 example:
(async function () {
await console.npm("loadsh")
console.log(_.random(5)) //2
})()
console.edit
This methods allows you webpage as editor
If no arguments are passed, all webpage will as editor
console.edit()
Of course, you can also pass parameters and select a DOM as the editor
console.edit('#app')
console.color()
It can help you print out color information in the devtools
console.color([
{
color?: string,
content?: any,
backgroundColor?: string
}
])
🌰 example:
console.color([
{
color: 'red',
content: 'red',
backgrounColor: 'rgb(0, 255, 0)'
},
{
color: 'rgb(0, 255, 0)',
content: 'green'
},
{
color: '#000FFF',
content: 'blue'
}
])
console.img
if you want to print images in the devtools, let's use it
console.img(url, {
width?: number,
height?: number
})
console.video
If you still want to watch video in devtools, you must try it
console.video(url, {
width?: number,
height?: number,
loop?: boolean
})
console.loading
a loading gif
console.loading('loading...')