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

node-dis-file

v1.0.1

Published

Allows you to easily upload and retrieve files to/from Discord channels via webhooks.

Downloads

8

Readme

About

Welcome to node-dis-file, a simple Node.js module for uploading and downloading files using Discord Webhooks

node-dis-file is a Node.js package that simplifies file storage via Discord Webhooks. It allows you to send and retrieve files over 20 MB!

Important:

Ensure you are aware of the usage guidelines of Discord webhooks to avoid any misuse.

Features

  • [✅] Upload a file to Discord Webhooks
  • [✅] Supports file splitting to avoid Discord Limits
  • [✅] No API-Key required
  • [✅] 100MB Tested
  • [✅] Upload ReadableStream
  • [✅] Download as file
  • [✅] Download as buffer

Installation

npm install node-dis-file

Examples

Uploading

Here is an example of how to upload a file using file path.

const { DisFile } = require("node-dis-file");

const myWebhookURL = "https://discord.com/api/webhooks/webhook_id/webhook_token";
const disFile = new DisFile(myWebhookURL);

const filePath = "./testfile.pdf";

const fileDetails = await disFile.uploadFile(filePath, "testfile.pdf");
console.log(fileDetails);  // Logs the file details from the webhook response

Here is an example of how to upload a file using read stream.

const { DisFile, Utils } = require("node-dis-file")

const myWebhookURL = "https://discord.com/api/webhooks/webhook_id/webhook_token";
const disFile = new DisFile(myWebhookURL);

const response = await axios.get('https://example.com/image.jpg', { responseType: 'arraybuffer' });

// Convert the response data into a buffer
const imageBuffer = Buffer.from(response.data);
const readable = Utils.createChunkedStream(imageBuffer);

const fileDetails = await disFile.uploadFileStream(readable, "MyUploadedImage.jpg")
console.log(fileDetails)

This is how the output looks like

{
  primaryID: '1322358044503314546',
  fileName: 'MyUploadedImage.jpg',
  fileChunkIDs: [
    '1322358033661038643', // 20 MB
    '1322358038149070859',  // 20 MB
    '1322358044008644681'  // 4.5 MB
  ]
}

Downloading

Here is an example of how to download a file, file as output.

const { DisFile } = require("node-dis-file")

const myWebhookURL = "https://discord.com/api/webhooks/webhook_id/webhook_token";
const disFile = new DisFile(myWebhookURL);

const filePrimaryID = "1322358044503314546"; // ID gotten from the uploads
const downloadedFile = await disFile.downloadFile(filePrimaryID, "merged.jpg");
console.log(downloadedFile); // Image saved successfully

Here is an example of how to download a file, buffer as output.

const { DisFile } = require("node-dis-file")

const myWebhookURL = "https://discord.com/api/webhooks/webhook_id/webhook_token";
const disFile = new DisFile(myWebhookURL);

const filePrimaryID = "1322358044503314546"; // ID gotten from the uploads
const downloadedFile = await disFile.downloadFileBuffer(filePrimaryID); // Returns a buffer of the file
// Do whatever you want with the buffer.

Contributing

Feel free to contribute! Whether you're fixing a bug, adding a feature, or improving documentation, your contributions are always welcome.