# subtext

> HTTP payload parsing

Latest version **6.0.12** (published 2019-01-31) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install subtext
pnpm add subtext
yarn add subtext
bun add subtext
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.0.12 |
| Published | 2019-01-31 |
| First published | 2014-09-29 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 1 (+3 in 3 direct dependencies) |
| Install scripts | no |
| Maintainers | hueniverse, johnbrett, marsup, nlf, wyatt |
| Keywords | http, payload, file, stream, multipart |

## Links

- npm: https://www.npmjs.com/package/subtext
- Repository: https://github.com/hapijs/subtext
- Homepage: https://github.com/hapijs/subtext#readme
- Issues: https://github.com/hapijs/subtext/issues
- npm.io page: https://npm.io/package/subtext

## Dependencies (6)

- [pez](https://npm.io/package/pez.md) 4.x.x
- [boom](https://npm.io/package/boom.md) 7.x.x
- [hoek](https://npm.io/package/hoek.md) 6.x.x
- [wreck](https://npm.io/package/wreck.md) 14.x.x
- [bourne](https://npm.io/package/bourne.md) 1.x.x
- [content](https://npm.io/package/content.md) 4.x.x

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 6.0.12 (latest) — 2019-01-31
- 5.1.3 (v5-legacy) — 2024-01-06
- 5.0.1 (lts) — 2019-01-31
- 6.0.11 — 2018-11-03
- 6.0.10 — 2018-11-02
- 6.0.9 — 2018-11-01
- 6.0.8 — 2018-10-31
- 6.0.7 — 2017-11-03
- 6.0.6 — 2017-11-03
- 6.0.5 — 2017-10-22
- 6.0.4 — 2017-10-19
- 6.0.3 — 2017-09-28
- 6.0.1 — 2017-09-26
- 6.0.0 — 2017-09-18
- 5.0.0 — 2017-06-30
- … 25 more at https://npm.io/package/subtext/versions

## README

# subtext

HTTP payload parser.

[![Build Status](https://secure.travis-ci.org/hapijs/subtext.svg?branch=master)](http://travis-ci.org/hapijs/subtext)

Lead Maintainer: [Eran Hammer](https://github.com/hueniverse)

`subtext` parses the request body and returns it in a promise.

## Example

```javascript
const Http = require('http');
const Subtext = require('subtext');

Http.createServer(async (request, response) => {

  const { payload, mime } = await Subtext.parse(request, null, { parse: true, output: 'data' });

  response.writeHead(200, { 'Content-Type': 'text/plain' });
  response.end(`Payload contains: ${JSON.stringify(payload)}`);

}).listen(1337, '127.0.0.1');

console.log('Server running at http://127.0.0.1:1337/');

```

## API

See the [API Reference](API.md)

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