
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
hazelcast-store
Advanced tools
hazelcast-store is a Hazelcast implementation of express session store backed by the hazelcast-nodejs-client.
NOTE: This is a first pass, use at your own risk. I will be glad to accept pull requests to fix bugs or add new features.
npm install hazelcast-store express-session
HazelcastStore
and pass it to the express sessions API:const session = require('express-session');
const HazelcastStore = require('hazelcast-store')(session);
const hzStore = new HazelcastStore({ ttl: 15*60*1000, debugPrefix: 'oc' });
app.use(session({ store: hzStore, secret: 'argle bargle' }));
HazelcastClient
and setting the client instance on the HazelcastStore
:const HazelcastClient = require('hazelcast-client').Client;
const HazelcastConfig = require('hazelcast-client').Config;
const clientConfig = new HazelcastConfig.ClientConfig();
clientConfig.networkConfig.addresses = [{host: '127.0.0.1', 5701}];
HazelcastClient.newHazelcastClient(clientConfig).then((hzInstance) => {
hazelcastStore.setClient(hzInstance);
});
A full initialized Hazelcast Client is required. This client is either passed directly using the client
property, or it can be added after creating the HazelcastStore using the store.setClient() method (see example above). This method is probably the easiest because the code that creates an instance of the Hazelcast client is asynchronous, and express sessions needs to set early in the app.use() chain.
The following additional properties are optional:
ttl
Hazelcast session TTL (expiration) in milli-secondsdebugPrefix
prefix to use with debug module so this module's output can be seen with your app's debug outputdisableTTL
Disables setting TTL, keys will stay in Hazelcast until evicted by other means (overides ttl
)prefix
Key prefix defaulting to "sess:"logErrors
Whether or not to log client errors. (default: false
)
true
, a default logging function (console.error
) is provided.false
, no logging occurs.MIT
FAQs
Hazelcast implementation of expressjs session store
The npm package hazelcast-store receives a total of 25 weekly downloads. As such, hazelcast-store popularity was classified as not popular.
We found that hazelcast-store demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.