npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

image-djs

v3.0.3

Published

¡Generador de imagenes para tu bot de Discord!

Downloads

5

Readme

🎨 Image DJS

¡Un generador de imágenes para discord.js!

ADVERTENCIA: Si va a usar este módulo para versiones de discord.js inferiores a la v14 recuerde cambiar los parámetros de la función .render

Welcome

const { Welcomer } = require('image-djs');
// typescript: import { Welcomer } from 'image-djs';
const wlc = await new Welcomer()
	.setAvatar(
		'https://cdn.discordapp.com/avatars/742460533818654791/6464bafb21a43c243867fa090642dacb.png?size=4096'
	)
	.setBackground('https://i.pinimg.com/736x/33/75/00/33750046310a78fc55914a621c7e0991.jpg')
	.setBorderColor('#bce784', 0.5)
	.setAvatarBorderColor('#ff4546')
	// .setUserFont('52px "Segoe UI"') | Debes cargar una fuente personalizada con canvas
	// .setSubtitleFont('32px "Segoe UI"') | Debes cargar una fuente personalizada con canvas
	.setSubtitle('👋 Bienvenido al servidor')
	.setUsername('drgato#0001');

// para discord.js v14
const attachment = await wlc.render(true, `welcomer-${user.id}.png`);
channel.send({ files: [attachment] });

// para discord.js v13
const buffer = await wlc.render(false);
const attachment = new MessageAttachment(buffer, `welcomer-${user.id}.png`);

channel.send({ files: [attachment] });

channel.send({ files: [file] });

Ejemplo:

Rank card

const { Rank } = require('image-djs');
// typescript: import { Rank } from 'image-djs';

const rank = new Rank()
	.setBackground(
		'https://cdn.discordapp.com/banners/742460533818654791/2d15dbfefbabcc7dcc6d022eb6406522.png?size=4096'
	)
	.setAvatar(
		'https://cdn.discordapp.com/avatars/742460533818654791/6464bafb21a43c243867fa090642dacb.png?size=4096'
	)
	.setAvatarRoundStyle('roundedSquare')
	.setBoxColor('#9c89b8')
	.setLevelBarFill('#ffd166')
	.setLevelBarBackground('#466a91')
	.setLevelBarRadius(15)
	.setLevel(2)
	.setRank(1)
	.setRequiredXP(11150)
	.setTextXpTemplate('{current}/{needed} xp')
	.setNextLevelTemplate('Next level: {requiredXP}')
	.setUsername('drgato#0001')
	.setXp(1240)
	.setBadges(['HypeSquadBravery', 'ActiveDeveloper', 'Nitro', 'Booster24']);

// para discord.js v14
const attachment = await rank.render(true, `rank-${user.id}.png`);
channel.send({ files: [attachment] });

// para discord.js v13
const buffer = await rank.render(false);
const attachment = new MessageAttachment(buffer, `rank-${user.id}.png`);

channel.send({ files: [attachment] });

Ejemplo:

Ping

const { Ping } = require('image-djs');
// typescript: import { Ping } from 'image-djs';
const file = await new Ping()
	.setIcon('https://i1.sndcdn.com/avatars-twM1pq6gSk4YzN4F-N4zKuw-t500x500.jpg')
	.build(true, 'ping.png');

channel.send({ files: [file] });

Ejemplo:

⚠️ Próximamente más clases... Reporta los bugs en el GitHub del npm.