Socket
Socket
Sign inDemoInstall

@ocap/indexdb-elasticsearch

Package Overview
Dependencies
84
Maintainers
3
Versions
427
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ocap/indexdb-elasticsearch

OCAP indexdb adapter that uses elasticsearch as backend


Version published
Weekly downloads
31
increased by287.5%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

@ocap/indexdb-elasticsearch

styled with prettier

OCAP indexdb adapter that stores data in elasticsearch

Install

npm install @ocap/indexdb-elasticsearch
// or
yarn add @ocap/indexdb-elasticsearch

Usage

const ESIndexDB = require('@ocap/indexdb-elasticsearch');

const indexdb = new ESIndexDB({
  tokenLength: 28,
  endpoint: process.env.ES_ENDPOINT,
  auth:
    process.env.ES_USERNAME && process.env.ES_PASSWORD
      ? {
          username: process.env.ES_USERNAME,
          password: process.env.ES_PASSWORD,
        }
      : null,
  prefix: 'dev',
  requestTimeout: 30000,
});

If you run this in production please set ES_SHARD_COUNT and ES_REPLICA_COUNT properly to achieve better reliability and performance

Run test

Create a file: indexdb/elasticsearch/.env.test, and input:

ES_ENDPOINT=<elasticsearch endpoint>
ES_USERNAME=<elasticsearch username>
ES_PASSWORD=<elasticsearch password>

Keywords

FAQs

Last updated on 07 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc