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

ddivfs

v1.0.4-beta.2.0

Published

ddivfs πŸ“‚πŸ”’ - A Secure and Efficient File Upload Middleware for Node.js. ddivfs is a lightweight and highly secure file upload middleware designed for seamless file uploads with built-in security features and optimizations. Whether you're handling images,

Readme

ddivfs

ddivfs is a high-performance, lightweight Node.js middleware designed for handling multipart/form-data, making file uploads seamless and efficient. It ensures optimal performance with minimal resource usage.

Whether you're handling small files or large-scale uploads, ddivfs is designed to be fast, reliable, and easy to integrate with your existing Express.js or Node.js applications.

πŸš€ Why Choose ddivfs?

βœ” Blazing Fast – Optimized for speed and efficiency
βœ” Minimal Memory Usage – Handles large file uploads without excessive RAM consumption
βœ” Seamless Integration – Works effortlessly with Express.js and other frameworks
βœ” Single File Support – Upload single files in a single request
βœ” Every week new features – New features added every week
⚠ Note: ddivfs only processes forms encoded as multipart/form-data. Other form types will be ignored.

πŸ“– Documentation & More: Explore the official documentation and updates at ddiv.online.

Installation

npm install ddivfs

πŸš€Usage

πŸ“Œ Ensure Your Form Uses multipart/form-data .To correctly upload a file, your form must use the multipart/form-data encoding type. Here's an example HTML form: .

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Upload File</title>
</head>
<body>
   <input type="file" id="fileInput" />
   <button onclick="uploadFile()">Upload</button>

   <script>
       function uploadFile() {
           const fileInput = document.getElementById("fileInput");
           const file = fileInput.files[0];

           const formData = new FormData();
           formData.append("file", file);

           fetch("http://localhost:5000/upload", {
               method: "POST",
               body: formData,
           })
           .then(response => response.json())
           .then(data => console.log("Success:", data))
           .catch(error => console.error("Error:", error));
       }
   </script>
</body>
</html>

πŸ“Œ Handling File Uploads in Node.js with ddivfs

const express = require("express");
const ddivfs = require("ddivfs");

const app = express();

app.post("/file", async (req, res) => {
   let arrayBuffer = [];

   req.on("data", (chunk) => {
      arrayBuffer.push(chunk);
   });

   req.on("end", async () => {
      let buffer = Buffer.concat(arrayBuffer);
      
      // Create an instance of the fileStream class with the request and buffer
      let sendFl = new ddivfs(req, buffer, 'me');
      
      try {
         // Process the file and get the information
         let file = await sendFl.buffersend();
         console.log(file);
         //if you want to see the information about the file 
         let fileInfo = await sendFl.getFileInfo();
         console.log(fileInfo);
         
         // Send the processed file as a response
         res.json(file);
      } catch (error) {
         res.status(500).json({ error: 'File processing failed' });
      }
   });
});

Collaborators

Abdifitaah moha Hassan
Website | github