# itemsapi

> Javascript client for ItemsAPI

Latest version **2.1.0** (published 2020-11-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install itemsapi
pnpm add itemsapi
yarn add itemsapi
bun add itemsapi
```

## 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 | 2.1.0 |
| Published | 2020-11-01 |
| First published | 2015-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 40.8 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | Mateusz Rzepa |
| Maintainers | cigolpl |

## Links

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

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.19.2

## Recent versions

- 2.1.0 (latest) — 2020-11-01
- 2.0.10 — 2020-08-17
- 2.0.8 — 2020-06-18
- 2.0.6 — 2020-06-18
- 2.0.4 — 2020-06-05
- 2.0.2 — 2020-05-29
- 2.0.0 — 2020-05-28
- 1.0.74 — 2017-03-23
- 1.0.73 — 2017-02-08
- 1.0.72 — 2017-01-30
- 1.0.71 — 2017-01-29
- 1.0.70 — 2017-01-28
- 1.0.69 — 2017-01-28
- 1.0.68 — 2017-01-27
- 1.0.67 — 2017-01-02
- … 65 more at https://npm.io/package/itemsapi/versions

## README

# ItemsAPI Javascript 

Javascript client for ItemsAPI 2.0

## Installation

```sh
npm install itemsapi
```

### Run ItemsAPI

There are many easy ways to run ItemsAPI 2.0 server.

The simplest one is by using Docker:

```bash
docker run --privileged -it -p 3000:3000 itemsapi/itemsapi:latest
```

## Getting started

Here is a quickstart for a search request

```js
const ItemsAPI = require('itemsapi')

(async () => {
  const client = new ItemsAPI({
    host: 'http://127.0.0.1:3000'
  })

  const index = client.getIndex();

  let response = await index.updateConfig(config);
  response = await index.addItems(items);
  response = await index.search({
    per_page: 3,
    filters: {
      tags: ['epic']
    },
    facets_fields: ['tags']
  });
  console.log(response);
})();
```


## API Resources

### Search 

- Make a search request:

`await index.search(input)`

- List filters for specific facet:

`await index.facet(input)`

### Index 

- Get index object:

`client.getIndex()`

### Items

- Add items:

`await index.addItems(items)`

- Get item:

`await index.getItem(id)`

- Update item partially:

`await index.partialUpdateItem(id, data)`

- Update item:

`await index.updateItem(id, data)`

- Delete item:

`await index.deleteItem(id)`


### Configuration

- Get configuration:

`await index.getConfig()`

- Update configuration:

`await index.updateConfig(config)`

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