# @aspida/ky

> ky client for aspida

Latest version **0.10.2** (published 2020-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aspida/ky
pnpm add @aspida/ky
yarn add @aspida/ky
bun add @aspida/ky
```

## 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.10.2 |
| Published | 2020-11-06 |
| First published | 2020-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1075 |
| Author | Solufa |
| Maintainers | solufa, m-mitsuhide |
| Keywords | aspida, typescript, ky, ky-universal |

## Links

- npm: https://www.npmjs.com/package/@aspida/ky
- Repository: https://github.com/aspida/aspida
- Homepage: https://github.com/aspida/aspida/tree/master/packages/aspida-ky#readme
- Issues: https://github.com/aspida/aspida/issues
- npm.io page: https://npm.io/package/@aspida/ky

## Dependencies (1)

- [aspida](https://npm.io/package/aspida.md) ^0.22.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.10.2 (latest) — 2020-11-06
- 0.10.1 — 2020-10-15
- 0.10.0 — 2020-09-20
- 0.9.3 — 2020-09-08
- 0.9.2 — 2020-09-06
- 0.9.1 — 2020-09-06
- 0.9.0 — 2020-08-29
- 0.8.2 — 2020-08-11
- 0.8.1 — 2020-07-28
- 0.8.0 — 2020-07-27
- 0.7.4 — 2020-06-27
- 0.7.3 — 2020-06-26
- 0.7.2 — 2020-06-25
- 0.7.1 — 2020-06-25
- 0.7.0 — 2020-06-25
- … 24 more at https://npm.io/package/@aspida/ky/versions

## README

# @aspida/ky
<br />
<br />
<br />
<br />
<img src="https://aspida.github.io/aspida/logos/svg/black.svg" alt="aspida" title="aspida" width="1000" height="120" />
<br />
<br />
<div align="center">
  <a href="https://www.npmjs.com/package/@aspida/ky">
    <img src="https://img.shields.io/npm/v/@aspida/ky" alt="npm version" />
  </a>
  <a href="https://www.npmjs.com/package/@aspida/ky">
    <img src="https://img.shields.io/npm/dm/@aspida/ky" alt="npm download" />
  </a>
  <a href="https://github.com/aspida/aspida/actions?query=workflow%3A%22Node.js+CI%22">
    <img src="https://github.com/aspida/aspida/workflows/Node.js%20CI/badge.svg?branch=master" alt="Node.js CI" />
  </a>
  <a href="https://codecov.io/gh/aspida/aspida">
    <img src="https://img.shields.io/codecov/c/github/aspida/aspida.svg" alt="Codecov" />
  </a>
  <a href="https://lgtm.com/projects/g/aspida/aspida/context:javascript">
    <img src="https://img.shields.io/lgtm/grade/javascript/g/aspida/aspida.svg" alt="Language grade: JavaScript" />
  </a>
</div>
<br />
<div align="center"><a href="https://github.com/sindresorhus/ky/">ky</a> client for <a href="https://github.com/aspida/aspida/">aspida</a>.</div>
<br />
<br />

## Getting Started

### Installation

- Using [npm](https://www.npmjs.com/):

  ```sh
  $ npm install @aspida/ky ky
  ```

- Using [Yarn](https://yarnpkg.com/):

  ```sh
  $ yarn add @aspida/ky ky
  ```

### Make HTTP request from application

`src/index.ts`

```typescript
import ky from "ky"
import aspida from "@aspida/ky"
import api from "../api/$api"

const kyConfig = { timeout: 3000, prefixUrl: "https://example.com/api" }
const client = api(aspida(ky, kyConfig))
;(async () => {
  const userId = 0
  const limit = 10

  await client.v1.users.post({ name: "mario" })

  const res = await client.v1.users.get({ query: { limit } })
  console.log(res)
  // req -> GET: https://example.com/api/v1/users/?limit=10
  // res -> { status: 200, data: [{ id: 0, name: "mario" }], headers: {...} }

  const user = await client.v1.users._userId(userId).$get()
  console.log(user)
  // req -> GET: https://example.com/api/v1/users/0
  // res -> { id: 0, name: "mario" }
})()
```

## License

@aspida/ky is licensed under a [MIT License](https://github.com/aspida/aspida/blob/master/packages/aspida-ky/LICENSE).

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