# @kard/node-request

> Simple NodeJS http/https client.

Latest version **0.1.0-rc.2** (published 2021-02-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install @kard/node-request
pnpm add @kard/node-request
yarn add @kard/node-request
bun add @kard/node-request
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-rc.2 |
| Published | 2021-02-19 |
| First published | 2021-02-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dmitry Karmalita |
| Maintainers | kard |
| Keywords | http, https, client, node |

## Links

- npm: https://www.npmjs.com/package/@kard/node-request
- Repository: https://github.com/dkarmalita/kard-node-request
- Homepage: https://github.com/dkarmalita/kard-node-request#readme
- Issues: https://github.com/dkarmalita/kard-node-request/issues
- npm.io page: https://npm.io/package/@kard/node-request

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^4.1.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

- 0.1.0-rc.2 (latest) — 2021-02-19
- 0.1.0-rc.1 — 2021-02-19

## README

# node-request

## Usage pattern

```sh
npm add -S @kard/node-request
```

```js
const Request = require('@kard/node-request');

const request = new Request({
  timeout: config.httpTimeout || 10000,
  // Optional. Default itmeout is 10s (10000ms)

  headers: {
  // Optional. These default headers will be added to each request.
    Authorization: `Basic ${authToken}`,
  },
})

await request(`https://httpstat.us/200?sleep=200`)
await request(
  `https://httpstat.us/200?sleep=200`, 
  { 
    method: 'POST', 
    // Optional, Default is 'GET'
    
    postData: { user: 'User Name', password: 'password' },
    // Optional. Default is {}
    
    headers: {},
    // Optional. Will be combained with the default headers.
  }
)

```

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