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 🙏

© 2026 – Pkg Stats / Ryan Hefner

kira-arts

v1.8.0

Published

TypeScript library to generate Discord-style profile, welcome and achievement cards

Readme

kira-arts 💞

A TypeScript library for generating Discord-style visual cards — profiles, welcome/leave events, level-ups, achievements, leaderboards, compatibility "ship" cards, now-playing music cards, and giveaways — rendered natively for speed and zero runtime dependencies on a browser or headless Chromium.

📚 Full documentation, live examples, and a Playground: documentation

npm version npm downloads install size license node types TypeScript tests release GitHub stars commit activity last commit open issues PRs welcome code style: prettier

✨ Features

  • 🖼️ Profile, Welcome/Leave, Level Up, Achievement, Leaderboard, Ship (compatibility), Now Playing, Giveaway, Birthday, Marriage, Weekly Recap, and Code Snippet cards
  • 🎵 Now Playing card ships with adapters for moonlink.js, Lavalink-based clients (erela.js, Shoukaku, Kazagumo, Riffy, Magmastream, lavalink-client), discord-player, and distube
  • 💻 Code Snippet card renders syntax-highlighted code screenshots (JavaScript, TypeScript, Python, Java, C#, JSON, Bash, plaintext) in 6 built-in editor themes, without needing a Discord user ID
  • 🎨 8 built-in themes (discord, midnight, sunset, neon, forest, sakura, monochrome, gold), Nitro/role-color aware borders, and up to 4 custom border colors with linear, mixed, or random blending
  • 🧾 Output as png, jpeg, or webp, ready to use as a discord.js AttachmentBuilder via toAttachment()
  • ⚡ Built-in, configurable in-memory cache for fetched user data (setCacheOptions, clearCache, getCacheSize)
  • 🛡️ Typed error handling with KiraError and KiraErrorCode, instead of opaque runtime failures
  • 📦 Dual package: ESM and CommonJS builds, both with full type declarations, no extra config needed
  • 📐 Selectable size (compact, standard, wide) for Level Up cards, rendered as vectors so every size stays sharp
  • 🏷️ Optional "NEW MEMBER" / "MEMBER LEFT" pill on Welcome/Leave cards, which can be hidden with showKindLabel: false

📦 Installation

npm install kira-arts
yarn add kira-arts
pnpm add kira-arts
bun add kira-arts

Requires Node.js >= 20 and a project with discord.js ^14.27.0 already installed (peer dependency).

🚀 Quick usage

import { Client, GatewayIntentBits } from "discord.js";
import { setClient, profileImage, toAttachment } from "kira-arts";

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
  ],
});

client.once("clientReady", () => {
  setClient(client); // 👈 required before generating any card
});

client.on("messageCreate", async (message) => {
  if (message.author.bot || message.content !== "!card") return;

  const buffer = await profileImage(message.author.id, {
    guildId: message.guild?.id,
    useRoleColor: true,
    presenceStatus: message.member?.presence?.status,
    badgesFrame: true,
  });

  await message.reply({ files: [toAttachment(buffer, { name: "profile", extension: "png" })] });
});

client.login(process.env.TOKEN);

Every other card, the music adapters, theming, caching, error handling, and output options are documented with live examples at documentation.

🃏 Cards at a glance

| Card | Function | What it's for | | ------------ | ------------------------------------------------- | ----------------------------------------------------------- | | Profile | profileImage(userId, options) | Avatar, badges, nameplate, server tag, rank | | Welcome | welcomeImage(userId, guildName, options) | Member join events, with an optional hideable kind pill | | Leave | leaveImage(userId, guildName, options) | Member leave events, with an optional hideable kind pill | | Level Up | levelUpImage(userId, level, options) | XP progress bar on level-up, in compact/standard/wide sizes | | Achievement | achievementImage(userId, title, options) | Unlockable achievements with rarity tiers | | Leaderboard | leaderboardImage(entries, options) | Server ranking table | | Ship | shipImage(leftUserId, rightUserId, options) | Compatibility between two users | | Now Playing | nowPlayingImage(track, options) | Music player card with source detection | | Giveaway | giveawayImage(prize, options) | Prize, host, entry count, winners on end | | Birthday | birthdayImage(userId, options) | Balloons, confetti, and an optional age/years counter | | Marriage | marriageImage(leftUserId, rightUserId, options) | Certificate-style card with automatic days-together count | | Weekly Recap | weeklyRecapImage(userId, options) | Wrapped-style weekly summary with a 7-day activity chart | | Code Snippet | codeSnippetImage(code, options) | Carbon-style syntax-highlighted code screenshot |

🛠️ Utilities

| Function | What it's for | | ----------------------------------------------- | ---------------------------------------------------------------------- | | setClient(client) | Registers your discord.js client — required before generating any card | | toAttachment(buffer, name, format) | Wraps a card buffer into a discord.js AttachmentBuilder | | encodeCanvas(canvas, options) | Encodes a raw canvas to png / jpeg / webp | | extensionForFormat(format) | Returns the file extension for an OutputFormat | | setCacheOptions(options) | Configures the internal user-data cache (enable, TTL) | | clearCache() | Clears the internal user-data cache | | getCacheSize() | Returns the number of entries currently cached | | computeCompatibility(leftUserId, rightUserId) | Deterministic compatibility percentage for the Ship card | | pickShipMessage(leftId, rightId, percentage) | Flavor text matching a compatibility percentage | | getThemePalette(theme) | Resolves a KiraThemeName to its full color palette | | fromMoonlinkTrack(track) | Adapter: moonlink.js track → NowPlayingTrack | | fromLavalinkTrack(track) | Adapter: Lavalink-based clients → NowPlayingTrack | | fromDiscordPlayerTrack(track) | Adapter: discord-player track → NowPlayingTrack | | fromDistubeTrack(song) | Adapter: distube song → NowPlayingTrack | | extractRequesterId(track) | Pulls the requester's user ID out of any supported track |

THEMES (all 8 built-in palettes), KiraError / KiraErrorCode, and lower-level canvas/validation helpers (loadImageSafe, hexToRgb, hexToRgba, drawGradientBorder, drawCoverImage, parseHex, decimalToHex, parseImg, parsePng, isString, isNumber) are also exported for advanced use — see the documentation for details.

📄 License

Kira-Arts is released under the Apache-2.0 License.

Copyright © worddevs

🔗 Links

  • 📚 Documentation: https://guide.worddevs.dev/docs/kira-arts
  • 📦 NPM: https://www.npmjs.com/package/kira-arts
  • 💻 Repository: https://github.com/worddevs/kira-arts
  • 🐛 Issues: https://github.com/worddevs/kira-arts/issues
  • 🔀 Contributing: https://github.com/worddevs/kira-arts/blob/main/CONTRIBUTING.md