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

dexster-discord-transcript

v2.0.5

Published

A nicely formatted html transcript generator for discord.js.

Downloads

994

Readme

dexster-discord-transcript

npm npm version License discord.js

A robust Node.js module for generating high-fidelity HTML transcripts for Discord. This package specializes in producing transcripts that maintain the exact visual integrity of the Discord interface, supporting modern features and components.


Arabic Documentation | التوثيق بالعربية

تعد هذه المكتبة أداة قوية لمطوري برامج ديسكورد (Discord Bots) لإنشاء سجلات محادثات (Transcripts) بصيغة HTML تتميز بدقة عالية ومحاكاة تامة لواجهة ديسكورد الرسمية.

المميزات الرئيسية:

  • دقة التصميم: محاكاة كاملة لواجهة ديسكورد (الوضع الداكن، الخطوط الرسمية، والأبعاد).
  • دعم المكونات الحديثة: دعم كامل لـ Components V2 (Containers, Sections, Media Galleries).
  • تخصيص كامل: إمكانية تعديل الألوان، أسماء الملفات، والنصوص التذييلية.
  • الأمان: حماية مدمجة ضد هجمات XSS لضمان سلامة العرض في المتصفحات.

Key Features

  • High-Fidelity Rendering: Precise replication of the Discord UI, including dark mode styling, typography, and layout.
  • Markdown Support: Full processing of Discord flavored markdown (bold, italics, code blocks, etc.).
  • Component V2 Support: Complete implementation of modern Discord layout components like Containers, Sections, and Media Galleries.
  • Interactive Elements: Properly styled buttons, action rows, and reactions.
  • Enhanced Mentions: Accurate rendering of user, role, and channel mentions with integrated role coloring.
  • System Messaging: Support for system events such as user joins, boosts, and pinned messages.
  • XSS Protection: Comprehensive sanitization to ensure transcripts are safe for browser execution.
  • Image Persistence: Capability to embed image data directly within the HTML for offline accessibility.
  • Lightweight Output (Minified by default): Generated HTML is automatically minified (no HTML/CSS/JS comments + compact markup) to reduce file size.
  • Hosted Transcripts (Open on the Web): Upload transcripts to your own hosting provider and send a URL instead of forcing users to download files.

Installation

npm install dexster-discord-transcript
# or
pnpm add dexster-discord-transcript
# or
yarn add dexster-discord-transcript

Usage

Basic Implementation

const discordTranscripts = require('dexster-discord-transcript');

// For TypeScript:
// import * as discordTranscripts from 'dexster-discord-transcript';

const channel = message.channel; 

const attachment = await discordTranscripts.createTranscript(channel);

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

Hosted Transcript (Open in browser)

Instead of sending an .html file attachment, you can upload the generated transcript to any hosting provider you want (your own server, Cloudflare R2, S3, a paste service, etc.) and send the URL.

const discordTranscripts = require('dexster-discord-transcript');

const result = await discordTranscripts.createHostedTranscript(message.channel, {
  // You implement the upload — keep the provider choice fully in your hands.
  upload: async ({ html, filename, password }) => {
    // Example pseudo-code:
    // const url = await myUploader(html, { filename, password })
    // return { url }
    return { url: 'https://your-host.example/transcripts/' + filename };
  },

  // Optional: static password or auto-generated
  // password: 'MySecret123',
  passwordLength: 12,

  // Optional: name
  filename: `transcript-${message.channel.id}.html`,
});

// result = { url, password, filename }
await message.reply(
  `Transcript: ${result.url}\nPassword: ${result.password}`
);

Generating from Message Collections

const discordTranscripts = require('dexster-discord-transcript');

const messages = getMessages(); // Collection<string, Message> or Message[]
const channel = getChannel();

const attachment = await discordTranscripts.generateFromMessages(messages, channel);

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

Configuration Options

createTranscript(channel, options)

| Option | Type | Description | | :--- | :--- | :--- | | limit | number | Maximum messages to fetch (-1 for all). | | returnType | string | Output format: 'buffer', 'string', or 'attachment'. | | filename | string | Name of the output file. | | saveImages | boolean | Embed images directly in HTML. | | poweredBy | boolean | Toggle the "Powered by" footer visibility. | | hydrate | boolean | Enable server-side hydration. | | filter | function | Predicate function to filter messages. |

createHostedTranscript(channel, options)

Same options as createTranscript(..., { returnType: 'string' }) plus:

  • upload: (payload) => Promise<{ url: string }> (required)
    Receives { html, filename, password } and must return { url }.
  • password: string (optional) — if omitted, a random password is generated.
  • passwordLength: number (optional) — default 12.

Advanced: Image Compression

Integration with sharp allows for automated image optimization when using saveImages:

const { TranscriptImageDownloader } = require('dexster-discord-transcript');

const attachment = await discordTranscripts.createTranscript(channel, {
  saveImages: true,
  callbacks: {
    resolveImageSrc: new TranscriptImageDownloader()
      .withMaxSize(5120)            // Maximum size in KB
      .withCompression(40, true)    // 40% quality, convert to WebP
      .build(),
  },
});

Technical Specifications

  • Compatibility: discord.js v14 & v15.
  • Engine: React SSR for server-side HTML generation.
  • Runtime: Node.js 18.x or higher.
  • License: Apache-2.0.

Author

Developed and maintained by Ebrahim (1Dexster1). GitHub Profile