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.
require('ewd-qoper8-cache')
✓ const connectCacheTo = require('ewd-qoper8-cache');
EWD modules are CommonJS only; no ES module support.
connectCacheTo function
✓ connectCacheTo(this); // or connectCacheTo(this, params);
✗ connectCacheTo(this, {}) without passing the worker object correctly
The function must be called with the ewd-qoper8 worker context (this) as first argument.
events: dbOpened, dbClosed, DocumentStoreStarted
✓ this.on('dbOpened', function(status) { console.log('Status:', status); });
✗ Using Worker.on instead of this.on
Events are emitted on the worker instance (this) after connectCacheTo initialises them.
Sets up a worker module that opens a connection to Cache with configurable parameters.
// Example worker module for ewd-qoper8 using ewd-qoper8-cache
'use strict';
const connectCacheTo = require('ewd-qoper8-cache');
const params = {
path: process.env.CACHE_PATH || '/opt/cache/mgr',
username: process.env.CACHE_USER || '_SYSTEM',
password: process.env.CACHE_PASS || 'SYS',
namespace: process.env.CACHE_NAMESPACE || 'USER',
charset: 'UTF-8'
};
this.on('start', function(isFirst) {
connectCacheTo(this, params);
});
this.on('dbOpened', function(status) {
console.log('Cache opened by worker ' + process.pid + ': ' + JSON.stringify(status));
if (status.error) throw new Error(status.error);
});
this.on('dbClosed', function() {
console.log('Cache closed for worker ' + process.pid);
});
this.on('DocumentStoreStarted', function() {
console.log('DocumentStore ready for worker ' + process.pid);
});
Errors
Common errors & fixes
Error: Cannot find module 'cache'
The InterSystems Cache Node.js driver is not installed.
fixRun: npm install cache
Error: connectCacheTo is not a function
Module was imported incorrectly (e.g., as default import instead of require).
fixUse const connectCacheTo = require('ewd-qoper8-cache'); Error: Cannot connect to Cache: Connection refused
Cache database is not running or path/credentials are wrong.
fixVerify Cache is running and update params.path, username, password, namespace.
Audit
Dependencies
ewd-qoper8requiredCore module for worker process management; ewd-qoper8-cache integrates with it.
ewd-document-storerequiredLoaded automatically to provide a JavaScript interface to Cache global storage.
cacherequiredThe InterSystems Cache Node.js driver required for database connectivity.