Skip to content

noah227/console.image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

console.image

usage

type definition

// support both callback and Promise
image: (url: string, options?: TOption, callback?: Function) => Promise<void>

code example

import console from "@cynario/console.image"

// console.image(url, options?)

// render image with it's default size
console.image("http://127.0.0.1/x.png")

// render image with 198px as assigned width, height will be auto computed based on size ratio 
console.image("http://127.0.0.1/x.png", {width: 198})

// in vue, you can use it like this way
console.image(require("@/assets/x.png"))

// of course, you can still use raw functions of console
console.log("hello")

// extra example (Promise)
console.image("http://127.0.0.1/x.png").then(() => {
    console.log("Hi there! Now you can see the image!")
})

example

See example.

About

Log image in browser's console

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •