@tenryu/dummy-image
v1.0.1
Published
Easily get dummy images with JavaScript on the web.
Downloads
26
Readme
DummyImage
ja / en
Easily generate dummy images.
Usage
Random
import { DummyImage } from '@tenryu/dummy-image';
const imageUrl = DummyImage.getURL();
console.log(imageUrl);
Specifying options
import { DummyImage } from '@tenryu/dummy-image';
const imageUrl = DummyImage.getURL({
color: 'sky-blue',
text: 'hoge piyo',
width: 200,
height: 50,
});
console.log(imageUrl);
Option
| option | description | default |
| --- | --- | --- |
| color
| 'gray', 'sky-blue', 'pink', 'green', 'orange', 'white' | random |
| width
| width (px) | 150 |
| height
| height (px) | 150 |
| text
| text in image | |