Registry / storage / elastic-queue

elastic-queue

JSON →
library0.3.0jsnpmunverified

A batching queue for Elasticsearch Node.js client, version 0.3.0 (stable, last release 2015). It batches documents into bulk requests, supporting configurable concurrency, batch size, commit timeout, and rate limiting. Provides event listeners for drain, task, and batchComplete. Lightweight but unmaintained, not compatible with modern Elasticsearch client (v7+).

npm install elastic-queue
INSTALL
IMPORT
SIG · ELASTIC-QUEUE
E
elastic-queue
storagejavascriptv0.3.0
harness data pending
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.

ElasticQueue
const ElasticQueue = require('elastic-queue')
import ElasticQueue from 'elastic-queue'
CJS only; no ESM or named exports.
Queue instance
const queue = new ElasticQueue(...)
const queue = ElasticQueue(...)
Must use 'new' keyword.
options
{ elasticsearch: { client: { host: 'localhost:9200' } }, concurency: 1, batchSize: 500 }
{ host: 'localhost:9200' }
Options must be nested under 'elasticsearch.client'. Note typo 'concurency' (double c).

Creates an ElasticQueue with configurable host, pushes a single document, and listens for drain.

const ElasticQueue = require('elastic-queue'); const queue = new ElasticQueue({ elasticsearch: { client: { host: process.env.ELASTICSEARCH_HOST ?? 'localhost:9200' } }, batchSize: 100, commitTimeout: 1000 }); queue.on('drain', () => { console.log('Queue drained'); queue.close(); }); queue.push({ index: 'products', type: '_doc', id: 1, body: { title: 'Test' } });
Debug
Known issues
deprecatedPackage is unmaintained since 2015 and incompatible with Elasticsearch client v7+.
fix
Use @elastic/elasticsearch's built-in bulk helper or migrate to elasticsearch-bulk or bulk-writer.
affects: >=0.3.0
breakingTypo in option name: 'concurency' instead of 'concurrency'. Setting 'concurrency' will have no effect.
fix
Use 'concurency' (misspelled) in options.
affects: >=0.1.0 <=0.3.0
gotchaNo ESM support; cannot import with 'import' in Node.js without transpilation.
fix
Use require() or use dynamic import() with .mjs or transpile.
affects: >=0.1.0
gotchaThe 'type' parameter in documents is required but deprecated in Elasticsearch 7+; should be '_doc' or omitted.
fix
Set type to '_doc' for ES7+ compatibility, but better to migrate to newer library.
affects: >=0.1.0
Errors
Common errors & fixes
ElasticQueue is not a constructor
Missing 'new' keyword when instantiating.
fix
Use 'new ElasticQueue(options)'.
Cannot find module 'elastic-queue'
Package not installed or misspelled.
fix
Run 'npm install elastic-queue' and check package.json.
TypeError: queue.push is not a function
Queue not initialized correctly (maybe no 'new' or wrong import).
fix
Ensure const queue = new ElasticQueue(options).
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
24
Resources
elastic-queue — npm install elastic-queue · libregistry