canvacord
Advanced tools
Comparing version 4.0.2 to 5.0.0
@@ -1,1 +0,4 @@ | ||
module.exports = require("./src/Canvas"); | ||
const Canvacord = require("./src/Canvacord"); | ||
module.exports = Canvacord; | ||
module.exports.plugins = require("./src/Plugins"); |
{ | ||
"name": "canvacord", | ||
"version": "4.0.2", | ||
"description": "Simple & easy to use image manipulation module for discord bots with a lot of features like rank card, memes & more.", | ||
"version": "5.0.0", | ||
"description": "Powerful image manipulation package for beginners.", | ||
"main": "index.js", | ||
"scripts": { | ||
"docsgen": "jsdoc --configure .jsdoc.json --verbose", | ||
"test": "cd test && node index.js", | ||
"format": "prettier --write \"src/**/*.js\"" | ||
"test": "cd test && node ." | ||
}, | ||
"homepage": "https://canvacord.js.org", | ||
"repository": { | ||
@@ -17,21 +15,12 @@ "type": "git", | ||
"keywords": [ | ||
"Canvacord", | ||
"discord-canvas", | ||
"discord.js-canvas", | ||
"discord.js-image", | ||
"memes", | ||
"rank", | ||
"rank-card", | ||
"welcomer", | ||
"leaver", | ||
"dank-memer", | ||
"imagen", | ||
"imgen", | ||
"imagegen", | ||
"canvacord", | ||
"canvas", | ||
"jimp", | ||
"image", | ||
"manipulation", | ||
"easy", | ||
"simple", | ||
"fast", | ||
"api" | ||
], | ||
"author": "Snowflake107", | ||
"license": "GPL-3.0", | ||
"funding": { | ||
@@ -41,9 +30,12 @@ "type": "individual", | ||
}, | ||
"license": "GPL-3.0", | ||
"bugs": { | ||
"url": "https://github.com/Snowflake107/Canvacord/issues" | ||
}, | ||
"homepage": "https://canvacord.js.org", | ||
"dependencies": { | ||
"@jimp/custom": "^0.14.0", | ||
"@jimp/plugin-circle": "^0.14.0", | ||
"canvacord-assets": "^1.0.6", | ||
"canvas": "^2.6.1", | ||
"gifencoder": "^2.0.1", | ||
"jimp": "^0.14.0", | ||
"moment": "^2.27.0", | ||
"moment": "^2.29.0", | ||
"moment-duration-format": "^2.3.2", | ||
@@ -53,9 +45,7 @@ "node-canvas-with-twemoji-and-discord-emoji": "^1.1.4" | ||
"devDependencies": { | ||
"jsdoc": "^3.6.5", | ||
"jsdoc-skyceil": "^1.0.5", | ||
"prettier": "^2.0.5" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Snowflake107/Canvacord/issues" | ||
"captcha-canvas": "^2.2.1", | ||
"discord-canvas": "github:Snowflake107/discord-canvas", | ||
"jsdoc": "^3.6.6", | ||
"jsdoc-skyceil": "github:zyrouge/jsdoc-skyceil" | ||
} | ||
} |
110
README.md
# Canvacord | ||
Canvacord is a wrapper for canvas & jimp which can be used to create/manipulate images easily. | ||
This package is meant for beginners who don't know how to use canvas & stuffs. | ||
Powerful image manipulation tool to manipulate images easily. | ||
> ⚠ This package is not recommended to you if you know how to use canvas/other image manipulation tools. | ||
# Installation | ||
# Installing | ||
```bash | ||
npm i --save canvacord | ||
```sh | ||
npm i canvacord | ||
``` | ||
[![NPM](https://nodei.co/npm/canvacord.png)](https://nodei.co/npm/canvacord/) | ||
# Features | ||
- Beginner friendly | ||
- Supports Buffer or image url | ||
- Super fast image manipulation | ||
- Welcomer and leaver images | ||
- Rank card | ||
- and more... | ||
- Super simple and easy to use 😎 | ||
- Faster than canvacord v4 🚀 | ||
- More than **50 methods**...? Yay! 🎉 | ||
- Built on node-canvas and no bullsh*t involved 🔥 | ||
- Object oriented 💻 | ||
- Beginner friendly 🤓 | ||
- Supports emojis 😀 | ||
# Limitations | ||
- You can only create stuffs using the mentioned functions. | ||
- You cannot create super-fancy things | ||
- If you want to go deeper, you must learn canvas | ||
# Documentation | ||
**[https://canvacord.js.org](https://canvacord.js.org)** | ||
# Methods | ||
**[All The Methods are listed here](https://canvacord.js.org)** | ||
# Join our Discord server | ||
**[https://discord.gg/2SUybzb](https://discord.gg/2SUybzb)** | ||
# Example | ||
# Examples | ||
## Rank Card | ||
```js | ||
const canvacord = require("canvacord"); | ||
const img = "https://cdn.discordapp.com/embed/avatars/0.png"; | ||
async function create() { | ||
let img = await canvacord.trigger("./image.png"); | ||
canvacord.write(img, "triggered.gif"); | ||
const userData = getDataSomehow(); | ||
let color = await canvacord.color("#4E5D94"); | ||
canvacord.write(color, "color.png"); | ||
} | ||
const rank = new canvacord.Rank() | ||
.registerFonts() | ||
.setAvatar(img) | ||
.setCurrentXP(userData.xp) | ||
.setRequiredXP(userData.requiredXP) | ||
.setStatus("dnd") | ||
.setProgressBar("#FFFFFF", "COLOR") | ||
.setUsername("Snowflake") | ||
.setDiscriminator("0007"); | ||
create(); | ||
rank.build() | ||
.then(data => { | ||
const attachment = new Discord.MessageAttachment(data, "RankCard.png"); | ||
message.channel.send(attachment); | ||
}); | ||
``` | ||
# Discord.js Example | ||
### Preview | ||
![RankCard](https://raw.githubusercontent.com/Snowflake107/canvacord/v5-alpha/test/images/RankCard.png) | ||
## Other Examples | ||
```js | ||
@@ -60,3 +69,3 @@ const Discord = require("discord.js"); | ||
if (message.author.bot) return; | ||
if (message.content === "!trigger") { | ||
if (message.content === "!triggered") { | ||
let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' }); | ||
@@ -67,43 +76,8 @@ let image = await canvacord.trigger(avatar); | ||
} | ||
if (message.content === "!delete") { | ||
let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' }); | ||
let image = await canvacord.delete(avatar); | ||
let attachment = new Discord.MessageAttachment(image, "deleted.png"); | ||
return message.channel.send(attachment); | ||
} | ||
if (message.content === "!rank") { | ||
let rank = getRankSomehow(); | ||
let image = await canvacord.rank({ | ||
username, | ||
discrim, | ||
level: rank.level, | ||
rank: rank.rank, | ||
neededXP: rank.neededXP, | ||
currentXP: rank.currentXP, | ||
avatarURL: message.author.displayAvatarURL({ format: "png" }), | ||
color: "white", | ||
background: "https://link-to/superDuperBackground" | ||
}); | ||
let attachment = new Discord.MessageAttachment(image, "rank.png"); | ||
return message.channel.send(attachment); | ||
} | ||
}); | ||
client.login("Your_Bot_Token_here"); | ||
``` | ||
# Documentation | ||
**[https://canvacord.snowflakedev.xyz](https://canvacord.js.org)** | ||
# License | ||
This project is licensed under **[GNU GENERAL PUBLIC LICENSE](https://www.gnu.org/licenses/gpl-3.0.en.html)**. | ||
```md | ||
Everyone is permitted to copy and distribute verbatim copies | ||
of this license document, but changing it is not allowed. | ||
``` | ||
# Join Our Discord Server | ||
**[discord.gg/uqB8kxh](https://discord.gg/uqB8kxh)** | ||
# Note | ||
> ⚠ | In order to use `Canvacord#Welcomer`/`Canvacord#Leaver`/`Canvacord#CaptchaGen`, you may need to install packages like **[discord-canvas](https://npmjs.com/package/discord-canvas)** & **[captcha-canvas](https://npmjs.com/package/captcha-canvas)**. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 4 instances in 1 package
6
2405
0
1
132331
4
17167
27
81
+ Addedcanvacord-assets@^1.0.6
+ Addedcanvacord-assets@1.1.0(transitive)
- Removed@jimp/custom@^0.14.0
- Removed@jimp/plugin-circle@^0.14.0
- Removedjimp@^0.14.0
- Removed@babel/runtime@7.26.0(transitive)
- Removed@jimp/bmp@0.14.0(transitive)
- Removed@jimp/core@0.14.0(transitive)
- Removed@jimp/custom@0.14.0(transitive)
- Removed@jimp/gif@0.14.0(transitive)
- Removed@jimp/jpeg@0.14.0(transitive)
- Removed@jimp/plugin-blit@0.14.0(transitive)
- Removed@jimp/plugin-blur@0.14.0(transitive)
- Removed@jimp/plugin-circle@0.14.0(transitive)
- Removed@jimp/plugin-color@0.14.0(transitive)
- Removed@jimp/plugin-contain@0.14.0(transitive)
- Removed@jimp/plugin-cover@0.14.0(transitive)
- Removed@jimp/plugin-crop@0.14.0(transitive)
- Removed@jimp/plugin-displace@0.14.0(transitive)
- Removed@jimp/plugin-dither@0.14.0(transitive)
- Removed@jimp/plugin-fisheye@0.14.0(transitive)
- Removed@jimp/plugin-flip@0.14.0(transitive)
- Removed@jimp/plugin-gaussian@0.14.0(transitive)
- Removed@jimp/plugin-invert@0.14.0(transitive)
- Removed@jimp/plugin-mask@0.14.0(transitive)
- Removed@jimp/plugin-normalize@0.14.0(transitive)
- Removed@jimp/plugin-print@0.14.0(transitive)
- Removed@jimp/plugin-resize@0.14.0(transitive)
- Removed@jimp/plugin-rotate@0.14.0(transitive)
- Removed@jimp/plugin-scale@0.14.0(transitive)
- Removed@jimp/plugin-shadow@0.14.0(transitive)
- Removed@jimp/plugin-threshold@0.14.0(transitive)
- Removed@jimp/plugins@0.14.0(transitive)
- Removed@jimp/png@0.14.0(transitive)
- Removed@jimp/tiff@0.14.0(transitive)
- Removed@jimp/types@0.14.0(transitive)
- Removed@jimp/utils@0.14.0(transitive)
- Removed@types/node@16.9.1(transitive)
- Removedany-base@1.1.0(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbmp-js@0.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedbuffer-equal@0.0.1(transitive)
- Removedcentra@2.7.0(transitive)
- Removeddom-walk@0.1.2(transitive)
- Removedexif-parser@0.1.12(transitive)
- Removedfile-type@9.0.0(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedgifwrap@0.9.4(transitive)
- Removedglobal@4.4.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedimage-q@4.0.0(transitive)
- Removedis-function@1.0.2(transitive)
- Removedjimp@0.14.0(transitive)
- Removedjpeg-js@0.4.4(transitive)
- Removedload-bmfont@1.4.2(transitive)
- Removedmime@1.6.0(transitive)
- Removedmin-document@2.19.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedomggif@1.0.10(transitive)
- Removedpako@1.0.11(transitive)
- Removedparse-bmfont-ascii@1.0.6(transitive)
- Removedparse-bmfont-binary@1.0.6(transitive)
- Removedparse-bmfont-xml@1.1.6(transitive)
- Removedparse-headers@2.0.5(transitive)
- Removedphin@2.9.33.7.1(transitive)
- Removedpixelmatch@4.0.2(transitive)
- Removedpngjs@3.4.0(transitive)
- Removedprocess@0.11.10(transitive)
- Removedregenerator-runtime@0.13.110.14.1(transitive)
- Removedsax@1.4.1(transitive)
- Removedtimm@1.7.1(transitive)
- Removedtinycolor2@1.6.0(transitive)
- Removedutif@2.0.1(transitive)
- Removedxhr@2.6.0(transitive)
- Removedxml-parse-from-string@1.0.1(transitive)
- Removedxml2js@0.5.0(transitive)
- Removedxmlbuilder@11.0.1(transitive)
- Removedxtend@4.0.2(transitive)
Updatedmoment@^2.29.0