# scramjet-http-post

> A simple stateless http server that emits all posted objects as a stream

Latest version **1.3.91** (published 2022-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install scramjet-http-post
pnpm add scramjet-http-post
yarn add scramjet-http-post
bun add scramjet-http-post
```

## 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.3.91 |
| Published | 2022-02-01 |
| First published | 2016-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Scramjet / Michał Czapracki |
| Maintainers | patu, scramjetorg, michalcz, stoq |

## Links

- npm: https://www.npmjs.com/package/scramjet-http-post
- Repository: https://github.com/scramjetorg/scramjet-http-post
- Homepage: https://scramjet.org/
- Issues: https://github.com/scramjetorg/scramjet-http-post/issues
- npm.io page: https://npm.io/package/scramjet-http-post

## Dependencies (1)

- [scramjet](https://npm.io/package/scramjet.md) ^4.36.2

## Recent versions

- 1.3.91 (latest) — 2022-02-01
- 1.3.90 — 2021-06-15
- 1.3.89 — 2021-05-19
- 1.3.88 — 2021-04-28
- 1.3.87 — 2021-03-30
- 1.3.86 — 2021-03-29
- 1.3.85 — 2021-03-15
- 1.3.84 — 2021-02-02
- 1.3.83 — 2020-12-11
- 1.3.81 — 2020-10-28
- 1.3.80 — 2020-09-27
- 1.3.78 — 2020-09-21
- 1.3.77 — 2020-09-10
- 1.3.76 — 2020-09-09
- 1.3.75 — 2020-09-05
- … 75 more at https://npm.io/package/scramjet-http-post/versions

## README

Scramjet HTTP POST
-------------------

[![Greenkeeper badge](https://badges.greenkeeper.io/signicode/scramjet-http-post.svg)](https://greenkeeper.io/)

A simple HTTP server providing a stream of HTTP POST payloads in scramjet.


## API

The module exposes the following methods:

### scHTTP.body

`scHTTP.body([scramjet, ]server)` - a stream of post contents sent to the given server.

Arguments:

* `server` - your HTTP server

Currently suppotes POST content-types:

* `application/json` and `text/json`
* `application/form-data`

**Example**

Grabs "votes" off a http server and pushes to command line.

```javascript
    const scramjet = require("scramjet");
    const server = require("http").createServer().listen(6080);
    const scHTTP = require("scramjet-http-post");

    scHTTP.body(scramjet, server)
        .filter((data) => (data && typeof data === "object" && !isNaN(+data.vote) && typeof data.for === "string"))
        .map((data) => ({
            contestant: data.for.substr(0, 1).toUpperCase(),
            vote: data.vote <= 256 && data.vote >= 0 && +data.vote || NaN
        }))
        .filter((nr) => (console.log(nr), !isNaN(nr.vote)))
        .map((vote) => "F:" + vote.contestant + ",V:" + vote.vote.toString(16))
        .on("error", (err) => console.log(err && err.stack))
        .pipe(process.stdout);
```

## License and contributions

As of version 2.0 Scramjet is MIT Licensed and as of 1.0.0 so is this module.

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