Skip to content

upimg-backup/upimg-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Author Version License

Usage

Installation

npm install upimg

or

yarn add upimg

Require module

const upimg = require('upimg')

Support servers

server endpoint cookie url
alibaba aliexpress - ae01.alicdn.com
jd 京东 - img14.360buyimg.com
netease 网易严选 - yanxuan.nosdn.127.net
smms smms - i.loli.net
suning 苏宁易购 - image.suning.cn
xiaomi 小米有品 - shop.io.mi-img.com
xitu 掘金 - user-gold-cdn.xitu.io
panda 熊猫直播 require i.h2.pdim.gs
qcloud 云+社区 require ask.qcloudimg.com
weibo 微博 require wx1.sinaimg.cn

for chinese users: 由于某公司方面施压,upimg 将不维护以上列表外服务的可用性

Upload file

take alibaba for example

upimg.alibaba
    .upload('./test/nodejs.png')
    .then(json => console.log(json))
    .catch(err => console.error(err.message))

success response

{
    "url": "https://ae01.alicdn.com/kf/HTB1dYeZXZrrK1RjSspa763REXXaP.png",
    "type": {
        "ext": "png",
        "mime": "image/png"
    }
}

take panda for cookies required example

upimg.panda
    .cookie('foo=bar; xxx=123')
    .upload('./test/nodejs.png')
    .then(json => console.log(json))
    .catch(err => console.error(err.message))

success response

{
    "url": "https://i.h2.pdim.gs/601628d09da962bb7ae33344d1529303.png",
    "type": {
        "ext": "png",
        "mime": "image/png"
    }
}

Author

upimg © metowolf, Released under the MIT License.

Blog @meto · GitHub @metowolf · Twitter @metowolf · Telegram Channel @metooooo

Releases

No releases published

Packages

No packages published