# elastic-tiny-client

> [![Build](https://github.com/samuelgja/elastic-tiny-client/actions/workflows/build.yml/badge.svg)](https://github.com/samuelgja/elastic-tiny-client/actions/workflows/build.yml) [![Code quality check](https://github.com/samuelgja/elastic-tiny-client/action

Latest version **0.1.4** (published 2023-12-06) · 0 weekly downloads

## Install

```sh
npm install elastic-tiny-client
pnpm add elastic-tiny-client
yarn add elastic-tiny-client
bun add elastic-tiny-client
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2023-12-06 |
| First published | 2023-03-26 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1011.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | samuelgja |

## Links

- npm: https://www.npmjs.com/package/elastic-tiny-client
- Repository: https://github.com/samuelgja/elastic-tiny-client
- Homepage: https://github.com/samuelgja/elastic-tiny-client#readme
- Issues: https://github.com/samuelgja/elastic-tiny-client/issues
- npm.io page: https://npm.io/package/elastic-tiny-client

## Recent versions

- 0.1.4 (latest) — 2023-12-06
- 0.1.3 — 2023-08-23
- 0.1.2 — 2023-08-23
- 0.1.1 — 2023-07-26
- 0.1.0 — 2023-07-26
- 0.0.9 — 2023-06-15
- 0.0.7 — 2023-03-26
- 0.0.6 — 2023-03-26
- 0.0.5 — 2023-03-26
- 0.0.4 — 2023-03-26
- 0.0.3 — 2023-03-26
- 0.0.2 — 2023-03-26
- 0.0.1 — 2023-03-26

## README

# Elastic search tiny client

[![Build](https://github.com/samuelgja/elastic-tiny-client/actions/workflows/build.yml/badge.svg)](https://github.com/samuelgja/elastic-tiny-client/actions/workflows/build.yml) [![Code quality check](https://github.com/samuelgja/elastic-tiny-client/actions/workflows/code-check.yml/badge.svg)](https://github.com/samuelgja/elastic-tiny-client/actions/workflows/code-check.yml)
[![Build Size](https://img.shields.io/bundlephobia/minzip/elastic-tiny-client?label=Bundle%20size)](https://bundlephobia.com/result?p=elastic-tiny-client) [![NPM downloads](https://img.shields.io/npm/dm/elastic-tiny-client.svg?style=flat)](https://www.npmjs.com/package/elastic-tiny-client)


Zero dependency, fetch based tiny elasticsearch client.

Also it work's in browser, [node.js](http://nodejs.org/) and [bun](https://bun.sh/) 🥳
Probably can be also run in [deno](https://deno.land/), but not tested yet.


Why? Because I needed a elasticsearch client for [bun](https://bun.sh/) but [elasticsearch-js](https://github.com/elastic/elasticsearch-js) still not works 🥺

### Install

```bash 
yarn add elastic-tiny-client // or bun add elastic-tiny-client
```


### Simple usage

```ts
import { ElasticClient } from 'elastic-tiny-client'
const client = new ElasticClient({ hosts: ['http://localhost:9200'] })


const indexResult = await client.index({
  index: 'my-index',
  body: {
    title: 'test',
  },
})

const result = await client.search({
  index: 'my-index',
  body: {
    query: {
      match: {
        title: 'test',
      },
    },
  },
})


const deleteResult = await client.delete({
  index: 'my-index',
  id: indexResult.body._id,
})
```



Basic api are taken from [elasticsearch-rest-api-docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html).
There are still some parts missing, so PR's are welcome 😎.

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