# multipart-stack

> A `StreamStack` subclass that parses "multipart" data, often from SMTP or HTTP.

Latest version **0.0.4** (published 2011-05-10) · 0 weekly downloads

## Install

```sh
npm install multipart-stack
pnpm add multipart-stack
yarn add multipart-stack
bun add multipart-stack
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2011-05-10 |
| First published | 2011-03-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Nathan Rajlich |

## Links

- npm: https://www.npmjs.com/package/multipart-stack
- Repository: https://github.com/TooTallNate/node-multipart-stack
- npm.io page: https://npm.io/package/multipart-stack

## Dependencies (4)

- [bufferjs](https://npm.io/package/bufferjs.md) >= 0.2.3
- [bufferlist](https://npm.io/package/bufferlist.md) >= 0.0.6
- [header-stack](https://npm.io/package/header-stack.md) >= 0.0.2
- [stream-stack](https://npm.io/package/stream-stack.md) >= 1.1.1

## Recent versions

- 0.0.4 (latest) — 2011-05-10
- 0.0.3 — 2011-05-10
- 0.0.2 — 2011-03-25
- 0.0.1 — 2011-03-25

## README

node-multipart-stack
====================
### A `StreamStack` subclass that parses "multipart" data, often from SMTP or HTTP.


This module implements [Section 7.2 of RFC 1341][rfc1341]. It can be easily used
in conjunction with any node `ReadableStream`.


Usage
-----

Here's a simple HTTP server that can parse multipart requests, like from an HTML
multipart form.

    var http = require('http');
    var multipart = require('multipart-stack');

    var server = http.createServer(function(req, res) {
      var parsed = multipart.parseContentType(req.headers['content-type']);
      if (parsed.type === 'multipart') {
        var parser = new multipart.Parser(req, parsed.boundary);
        parser.on('part', function(part) {
          // Fired once for each individual part of the multipart message.
          // 'part' is a ReadableStream that also emits a 'headers' event.
          part.on('headers', function(headers) {
            console.log(headers);
          });
          part.pipe(process.stdout);
        });
      }
    });

[Node]: http://nodejs.org
[rfc1341]: http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

---
_Source: https://npm.io/package/multipart-stack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
