# enrise-esclient

> Elasticsearch client used within Enrise projects and module's

Latest version **2.0.2** (published 2026-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install enrise-esclient
pnpm add enrise-esclient
yarn add enrise-esclient
bun add enrise-esclient
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2026-05-14 |
| First published | 2016-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=20 |
| Dependencies | 3 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Team MatchMinds @ Enrise |
| Maintainers | edwardsmit, florish, roelandvanbatenburg, pandosearch_dev |

## Links

- npm: https://www.npmjs.com/package/enrise-esclient
- Repository: https://github.com/Enrise/node-esclient
- Homepage: https://github.com/Enrise/node-esclient#readme
- Issues: https://github.com/Enrise/node-esclient/issues
- npm.io page: https://npm.io/package/enrise-esclient

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.16.4
- [elasticsearch](https://npm.io/package/elasticsearch.md) ^15.5.0
- [agentkeepalive](https://npm.io/package/agentkeepalive.md) ^4.6.0

## Recent versions

- 2.0.2 (latest) — 2026-05-14
- 2.0.1 — 2026-05-14
- 0.1.5 — 2020-01-10
- 0.1.4 — 2018-02-13
- 0.1.3 — 2017-05-02
- 0.1.2 — 2017-04-21
- 0.1.1 — 2016-11-02
- 0.1.0 — 2016-11-01

## README

# Node.js esclient module

> A simple wrapper around the [elasticsearch](https://github.com/elastic/elasticsearch-js) client, optionally with [enrise-logger](https://github.com/Enrise/node-logger) integration.

## Deprecated

This repository is deprecated and will be archived.

### Requirements

Node.js ≥ 20

### Installation
NPM: `npm install enrise-esclient --save`  
Yarn: `yarn add enrise-esclient`

### Initialization and usage
Require and instantiate the client, where config is an optional object passed to [elasticsearch](https://www.npmjs.com/package/elasticsearch):  
`const ESClient = new require('enrise-esclient')([config: Object]);`

This instantiates an elasticsearch client with a KeepAlive agent.

### Configuration
The only default configuration option this module sets is the [`createNodeAgent`](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html#config-create-node-agent) to connect with a KeepAlive agent. Also it has extra logging abstractions (below). For further instructions on configuring the client see the official [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html).

#### `[log]`
This module optionally supports passing an [enrise-logger](https://github.com/Enrise/node-logger) instance to the client. To use this, initialize the logger beforehand, and then pass an instance to the esclient upon instantiation:  
```javascript
const enriseClient = require('enrise-client');

// Initialize enrise logger
const logger = require('enrise-logger')();

// Instantiate elasticsearch client with an enrise-logger
const client = new enriseClient({
  log: logger.get('Elasticsearch')
});
```

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