fdex

small form-data extractor


Keywords
multipart, form-data
License
MIT
Install
npm install fdex@0.1.1

Documentation

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