Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 15, 2024 via pnpm

busboy 1.6.0

A streaming parser for HTML form data for node.js
Package summary
Share
0
issues
1
license
2
MIT
Package created
27 May 2013
Version published
19 Apr 2022
Maintainers
1
Total deps
2
Direct deps
1
License
UNKNOWN

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
busboy@1.6.0
streamsearch@1.1.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of busboy 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
streamsearch1.1.05.24 kBMIT
prod

Visualizations

Frequently Asked Questions

What does busboy do?

Busboy is a powerful node.js module designed for parsing incoming HTML form data. This popular npm package allows developers to efficiently handle HTML form data, providing a streaming parser that proves highly beneficial in web development scenarios where form data needs to be parsed on the server side. By harnessing the power of streams, Busboy efficiently parses incoming HTTP requests that contain form data without sacrificing memory overhead.

How do you use busboy?

To use Busboy in your node.js application, start by installing the package using npm. You can do this by running npm install busboy from your project's root directory. After successfully installing Busboy, you can use it to parse incoming HTML form data with Node.js' HTTP module. Below are two basic usage examples:

Example 1: Parsing multipart form data with default options.

const http = require('http');
const busboy = require('busboy');

http.createServer((req, res) => {
  if (req.method === 'POST') {
    const bb = busboy({ headers: req.headers });
    // Bind event handlers to bb...
    req.pipe(bb);
  }
  // Handle GET requests...
}).listen(8000);

Example 2: Save all incoming files to disk

const http = require('http');
const busboy = require('busboy');

http.createServer((req, res) => {
  if (req.method === 'POST') {
    const bb = busboy({ headers: req.headers });
    bb.on('file', (name, file, info) => {
      file.pipe(fs.createWriteStream(`path/to/save/${name}`));
    });
    req.pipe(bb);
  }
  // Handle other HTTP methods...
}).listen(8000);

Please note, you must pipe the request stream into Busboy's form parser stream, and handle every incoming file and field using respective event handlers. Don't forget to listen for 'POST' requests before initiating the parser.

Where are the busboy docs?

The most comprehensive documentation for Busboy can be found directly in Busboy's GitHub repository. Here, you will find detailed information about the Busboy API, including example code snippets, configuration options for the parser, and various event handlers that the library provides. Additionally, this documentation dives into the configurable limits of incoming data and the special parser stream events that can be used to handle form parsing events like file uploads or fields limit reached. The API section carefully explains all the interfaces and events provided by the Busboy.