# neat-send

> Light-weight Promise wrap for raw http.request

Latest version **1.0.4** (published 2017-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install neat-send
pnpm add neat-send
yarn add neat-send
bun add neat-send
```

## 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.4 |
| Published | 2017-09-19 |
| First published | 2017-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zhuqiuyang |
| Maintainers | zhuqiuyang |
| Keywords | neat, send, http, request |

## Links

- npm: https://www.npmjs.com/package/neat-send
- Repository: https://github.com/Koa-js/neat-send
- Homepage: https://github.com/Koa-js/neat-send#readme
- Issues: https://github.com/Koa-js/neat-send/issues
- npm.io page: https://npm.io/package/neat-send

## Dependencies (1)

- [bluebird](https://npm.io/package/bluebird.md) ^3.5.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-09-19
- 1.0.3 — 2017-09-12
- 1.0.2 — 2017-09-12
- 1.0.1 — 2017-09-11
- 1.0.0 — 2017-09-08

## README

# neat-send
Light-weight Promise wrap for raw http.request

### Install
```shell
npm install neat-send
```

### Hello Send
```js
// Now is mostly used for proxy
const send = require('neat-send');

const server = http.createServer(async function(sreq, sres) {
  const url_parts = url.parse(sreq.url);
  const opts = {
    host: 'google.com',
    port: 80,
    path: url_parts.pathname,
    method: sreq.method,
    headers: sreq.headers
  };
  const ext = {
    body: sreq, // pipe server to client request
    // timeout(Num): If None, Default is 15sec
    // toJSON(bool): Default is False.
  };
  const cres = await send(opts, ext);
  sres.writeHead(cres.statusCode, cres.headers);
  cres.pipe(sres); // pipe client to server response
});
server.listen(80, '0.0.0.0');

```

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