1. 首页
  2. 考试认证
  3. 其它
  4. image exists 检查图像是否存在

image exists 检查图像是否存在

上传者: 2024-10-18 01:17:40上传 ZIP文件 2.54KB 热度 2次

形象存在检查图像是否存在。安装:npm install image-exists。用法:


var imageExists = require('image-exists');

var src = 'http://example.com/image.png';

imageExists(src, function(exists) {

  if (exists) {

    console.log(\"it's alive!\");

  } else {

    console.log(\"oh well\");

  }

});

下载地址
用户评论