Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvacord

Package Overview
Dependencies
Maintainers
5
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvacord - npm Package Compare versions

Comparing version 5.4.10 to 6.0.0-beta.0

dist/index.d.mts

95

package.json
{
"name": "canvacord",
"version": "5.4.10",
"description": "Powerful image manipulation package for beginners.",
"main": "index.js",
"types": "./typings/index.d.ts",
"bin": "./bin/canvacord.js",
"description": "Generate images on-the-fly with the help of wide range of templates.",
"version": "6.0.0-beta.0",
"main": "./dist/index.js",
"exports": {
"require": {
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"import": {
"default": "./dist/index.mjs",
"types": "./dist/index.d.mts"
}
},
"files": [
"bin",
"scripts",
"libs",
"plugins",
"src",
"index.js",
"typings"
"dist"
],
"dependencies": {
"@napi-rs/canvas": "^0.1.41",
"@napi-rs/image": "^1.7.0",
"@resvg/resvg-js": "^2.6.0",
"@skyra/gifenc": "^1.0.1",
"file-type": "16.5.4",
"satori": "^0.10.9",
"tailwind-merge": "^1.14.0"
},
"scripts": {
"docs": "docgen --source src --custom docs/index.yml --output docs/docs.json",
"docs:test": "docgen --source src --custom docs/index.yml",
"test": "cd test && node .",
"types": "tsc",
"postinstall": "node scripts/postinstall.mjs"
"format": "prettier --write \"./src/**/*.{js,ts,jsx,tsx}\"",
"build": "tsup",
"test": "tsx ./test/index.ts",
"test:jsx": "tsx ./test/jsxTest.tsx",
"bench": "cd ./benchmark && node jsx-renderer.mjs"
},
"repository": {
"type": "git",
"url": "git+https://github.com/neplextech/Canvacord.git"
"url": "git+https://github.com/neplextech/canvacord.git"
},
"keywords": [
"canvacord",
"canvas",
"canavcord",
"image",
"api",
"manipulation",
"easy",
"simple",
"fast",
"api",
"rank",
"card",
"rankcard",
"welcomer",
"leaver",
"spotify",
"memegen"
"nodejs",
"typescript"
],
"author": "neplextech",
"license": "GPL-3.0",
"author": "twlite",
"license": "MIT",
"bugs": {
"url": "https://github.com/neplextech/canvacord/issues"
},
"homepage": "https://canvacord.js.org",
"dependencies": {
"@napi-rs/canvas": "^0.1.29",
"@skyra/gifenc": "^1.0.0",
"chalk": "^5.0.1",
"moment": "^2.29.4",
"moment-duration-format": "^2.3.2",
"node-fetch": "2.6.7"
},
"homepage": "https://github.com/neplextech/canvacord#readme",
"packageManager": "yarn@3.6.0",
"devDependencies": {
"@discordjs/docgen": "^0.11.1",
"@types/node": "^16.4.7",
"typescript": "^4.7.4"
},
"packageManager": "yarn@3.6.0"
}
"@types/node": "^20.3.1",
"@types/react": "^18.2.12",
"benny": "^3.7.1",
"prettier": "^2.8.8",
"tailwindcss": "^3.3.3",
"tsup": "^7.2.0",
"tsx": "^3.12.7",
"typescript": "^5.1.3"
}
}
[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine)
# Canvacord
Powerful image manipulation tool to manipulate images easily.
# Installation
Easily generate images on-the-fly with node.js using wide range of templates.
```sh
$ npm i canvacord
```
> **Warning**
>
> You are looking at the next version of canvacord, which is under development. Go to the [legacy branch](https://github.com/neplextech/canvacord/tree/legacy) to view legacy codebase.
[![NPM](https://nodei.co/npm/canvacord.png)](https://nodei.co/npm/canvacord/)
## Features
# Features
- Super simple and easy to use 😎
- Faster than canvacord v4 🚀
- More than **50 methods**...? Yay! 🎉
- Built on top of **[@napi-rs/canvas](https://npm.im/@napi-rs/canvas)** 🔥
- Object oriented 💻
- Beginner friendly 🤓
- Supports emojis 😀
- image generation _(wip)_
- image manipulation _(wip)_
- image templates _(wip)_
- image filters _(wip)_
- complex layouts _(wip)_
# Documentation
**[https://canvacord.js.org](https://canvacord.js.org)**
## Example
**[Join our Discord server](https://neplextech.com/discord)**
### Image Generation
# Examples
## Rank Card
<!-- prettier-ignore -->
```ts
import { canvacord } from 'canvacord';
import fs from 'node:fs';
```js
const canvacord = require("canvacord");
const img = "https://cdn.discordapp.com/embed/avatars/0.png";
// triggered gif
const triggered = await canvacord.triggered(image);
triggered.pipe(fs.createWriteStream('triggered.gif'));
const userData = getDataSomehow();
// filters
const filtered = await canvacord
.filters(512, 512)
.drawImage(image)
.hueRotate(90)
.invert(2)
.sepia(1)
.opacity(0.5)
.saturate(2)
.encode();
const rank = new canvacord.Rank()
.setAvatar(img)
.setCurrentXP(userData.xp)
.setRequiredXP(userData.requiredXP)
.setStatus("dnd")
.setProgressBar("#FFFFFF", "COLOR")
.setUsername("Snowflake")
.setDiscriminator("0007");
// alternative syntax
const filtered = await canvacord(image, 512, 512)
.hueRotate(90)
.invert(2)
.sepia(1)
.opacity(0.5)
.saturate(2)
.encode();
rank.build()
.then(data => {
const attachment = new Discord.MessageAttachment(data, "RankCard.png");
message.channel.send(attachment);
});
fs.writeFileSync('filtered.png', filtered);
```
### Preview
![RankCard](https://raw.githubusercontent.com/neplextech/canvacord/main/test/images/RankCard.png)
## XP Card Preview
## Rank Card Variants
![RankCard](https://raw.githubusercontent.com/neplextech/canvacord/main/test/Gamer.png)
![RankCard](https://raw.githubusercontent.com/neplextech/canvacord/main/test/Nerd.png)
![RankCard](https://raw.githubusercontent.com/neplextech/canvacord/main/test/Player.png)
## Other Examples
```js
const Discord = require("discord.js");
const client = new Discord.Client();
const canvacord = require("canvacord");
client.on("ready", () => {
console.log("I'm online!");
});
client.on("message", async (message) => {
if (message.author.bot) return;
if (message.content === "!triggered") {
let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
let image = await canvacord.Canvas.trigger(avatar);
let attachment = new Discord.MessageAttachment(image, "triggered.gif");
return message.channel.send(attachment);
}
});
client.login("Your_Bot_Token_here");
```
# 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)**.
![xp-card](https://raw.githubusercontent.com/neplextech/canvacord/main/test/jsx/test2.svg)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc