Skip to content

Probably the fastest most compatible lexer/parser/stringifier for multipart/form-data

License

Notifications You must be signed in to change notification settings

mntm-lib/multipart

Repository files navigation

@mntm/multipart GitHub license

Probably the fastest most compatible lexer/parser/stringifier for multipart/form-data.

Usage

If you don't need to parse headers and encoding, use lexer:

import { formLexer } from '@mntm/multipart';

const lexed = formLexer(buffer);

Otherwise use parser:

import { formParser } from '@mntm/multipart';

const parsed = formParser(buffer);

For stiringify data to multipart/form-data:

import { fromStringify, BOUNDARY } from '@mntm/multipart';

const body = fromStringify({});

Installation

We recommend to use yarn for dependency management:

yarn add @mntm/multipart

License

@mntm/multipart is MIT licensed.