📖 更新文档

This commit is contained in:
陈小术 2021-11-11 10:54:44 +08:00
parent 93e3f4f7f3
commit 7c2559192a
2 changed files with 7 additions and 1 deletions

View File

@ -14,11 +14,13 @@ const opts = {
const create = async function (options) {
options = Object.assign({}, opts, options);
const { width, height, size, url } = options;
let image = url;
if (isUrl(url)) {
const axiosData = await axios({ url, responseType: "arraybuffer" });
image = axiosData.data;
}
const baseImage = await sharp(image).resize(width, height).png().toBuffer();
const left = randomRangeNum(size, width - size);
const top = randomRangeNum(size, height - size);

View File

@ -4,7 +4,11 @@
"description": "生成滑动验证码拼图图片和背景图片",
"main": "index.js",
"scripts": {
"test": "node test.js"
"test": "node test.js",
"version patch": "npm version patch",
"version minor": "npm version minor",
"version major": "npm version major",
"publish": "npm publish"
},
"repository": {
"type": "git",