random-image-placeholder

1.0.2 • Public • Published

Intro 介绍

A wrapper of picsum.photos to generate random image placeholder
一个调用 picsum.photos 的库, 可以生成随机占位图片

Use 使用方式

npm install -S random-image-placeholder
// import 引入
const ImgPlaceholder = require('random-image-placeholder');
 
// create instance 创建实例
// options is optional 配置选项是可选的
const imgGenerator = new ImgPlaceholder(options);
 
// generate 生成图片地址
const url = imgGenerator.generate();
console.log(url);

Options 配置选项

width in pixel 像素宽度

const imgGenerator = new ImgPlaceholder({
    width: 200
});

/random-image-placeholder/

    Package Sidebar

    Install

    npm i random-image-placeholder

    Weekly Downloads

    35

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    5.21 kB

    Total Files

    5

    Last publish

    Collaborators

    • imyy