# uws-body-parser

> A request body parser middleware for uWebSockets.js

Latest version **1.0.1** (published 2021-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install uws-body-parser
pnpm add uws-body-parser
yarn add uws-body-parser
bun add uws-body-parser
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-05-06 |
| First published | 2021-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Guy Or |
| Maintainers | guyo13 |

## Links

- npm: https://www.npmjs.com/package/uws-body-parser
- Repository: https://github.com/guyo13/uws-body-parser
- Homepage: https://github.com/guyo13/uws-body-parser#readme
- Issues: https://github.com/guyo13/uws-body-parser/issues
- npm.io page: https://npm.io/package/uws-body-parser

## Recent versions

- 1.0.1 (latest) — 2021-05-06
- 1.0.0 — 2021-05-06

## README

# uws-body-parser

uws-body-parser is a request body parsing middleware for uWebSockets.js.

## Typical usage

```js
const { App } = require('uWebSockets.js');

const { bodyParser } = require('uws-body-parser');

const app = App();

app.post('/my/api/endpoint', (res, req) => {
  bodyParser(res, req, (data, wasParsed) => {
      // `wasParsed` argument is a boolean indicating if the body was actually parsed
      if (!wasParsed) {
        console.log('Body not parsed!');
      }
      // `data` argument is the parsed JSON/xWwwFormUrlEncoded/Raw Buffer body
      console.log(data);
      // TODO: your logic here
    }, () => { console.error('request aborted'); }
  );
});
```

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