Registry / database / elasticsearch-store

elasticsearch-store

JSON →
library2.11.1jsnpmunverified

elasticsearch-store (v2.11.1) is a TypeScript library for managing Elasticsearch indices with versioning and migration support. It provides a structured API to create, update, and migrate indices, ensuring schema evolution over time. Released under the Terascope organization, it targets Node.js >=22 and pnpm >=11.3. Key differentiators include built-in migration handling, type-safe index management, and integration with the Teraslice ecosystem. Maintained actively with a focus on reliability.

databasedevops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only since v2. Default export not available.

import { IndexStore } from 'elasticsearch-store'

Named export, not default.

import { Migration } from 'elasticsearch-store'

Use type import for TypeScript interfaces.

import type { StoreConfig } from 'elasticsearch-store'

Initializes an IndexStore with client, defines mapping and version, creates index, indexes a document, and retrieves it.

import { Client } from '@elastic/elasticsearch'; import { IndexStore } from 'elasticsearch-store'; async function main() { const client = new Client({ node: process.env.ELASTICSEARCH_URL ?? 'http://localhost:9200' }); const store = new IndexStore(client, { name: 'my-index', version: 1, mappings: { properties: { name: { type: 'text' }, age: { type: 'integer' } } } }); await store.initialize(); await store.indexDocument({ name: 'John', age: 30 }); const doc = await store.getDocument('some-id'); console.log(doc); } main().catch(console.error);
Debug
Known footguns
breakingRequires Node.js >=22.0.0 and pnpm >=11.3.0. Older versions are not supported.
gotchaIndex migrations must be explicitly applied after initialization.
deprecatedThe `IndexStore` constructor no longer accepts `client` as second argument in v2. Use options object.
gotchaTypeScript strict mode may require explicit type annotations for generic methods.
breakingESM-only module: CommonJS `require()` will fail.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
mj12bot
1
ahrefsbot
1
Resources