https://github.com/mntm-lib/multipart
Probably the fastest most compatible lexer/parser/stringifier for multipart/form-data
https://github.com/mntm-lib/multipart
form-data formdata lexer multipart parser perse stringifier stringify
Last synced: 10 months ago
JSON representation
Probably the fastest most compatible lexer/parser/stringifier for multipart/form-data
- Host: GitHub
- URL: https://github.com/mntm-lib/multipart
- Owner: mntm-lib
- License: mit
- Created: 2021-09-08T18:44:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-06T08:54:33.000Z (about 4 years ago)
- Last Synced: 2025-03-18T05:09:26.058Z (10 months ago)
- Topics: form-data, formdata, lexer, multipart, parser, perse, stringifier, stringify
- Language: TypeScript
- Homepage: https://npm.im/@mntm/multipart
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @mntm/multipart [](https://github.com/maxi-team/multipart/blob/master/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:
```js
import { formLexer } from '@mntm/multipart';
const lexed = formLexer(buffer);
```
Otherwise use parser:
```js
import { formParser } from '@mntm/multipart';
const parsed = formParser(buffer);
```
For stiringify data to multipart/form-data:
```js
import { fromStringify, BOUNDARY } from '@mntm/multipart';
const body = fromStringify({});
```
## Installation
We recommend to use [yarn](https://classic.yarnpkg.com/en/docs/install/) for dependency management:
```shell
yarn add @mntm/multipart
```
## License
@mntm/multipart is [MIT licensed](./LICENSE).