fdex
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

fdex

npm version types size coverage vulnerabilities dependencies License

small form-data extractor

Installation

$ npm i fdex

Usage

import fdex, {getBoundary} from 'fdex';
import express from 'express';

const app = express();

app.post('/', (req) => {
    const contentType = req.headers['content-type'];
    const boundary = getBoundary(contentType);

    const extractor = fdex(boundary);
    req.pipe(extractor)
        .on('data', ([headers, body]) => {
            console.info(headers, body);
        })
    ;
});

app.listen(3000);

About

Jet another multipart/form-data extractor/processor. This projects aim was to understand and process the multipart/form-data format without any additional dependencies.

Licence

MIT License, see LICENSE

Readme

Keywords

Package Sidebar

Install

npm i fdex

Weekly Downloads

2

Version

0.1.4

License

MIT

Unpacked Size

8.81 kB

Total Files

9

Last publish

Collaborators

  • sovrin