hazelcast-store
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "hazelcast-store", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Hazelcast implementation of expressjs session store", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
[![npm](https://img.shields.io/npm/v/hazelcast-store.svg)](https://npmjs.com/package/hazelcast-store) [![Dependencies](https://img.shields.io/david/jackspaniel/hazelcast-store.svg)](https://david-dm.org/jackspaniel/hazelcast-store) ![Downloads](https://img.shields.io/npm/dm/hazelcast-store.svg) | ||
**hazelcast-store** is a Hazelcast session store backed by [hazelcast-client](https://github.com/hazelcast/hazelcast-nodejs-client). | ||
### **hazelcast-store** is a Hazelcast implementation of [express session store](https://github.com/expressjs/session#compatible-session-stores) backed by the [hazelcast-nodejs-client](https://github.com/hazelcast/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.** | ||
## Setup | ||
# Setup | ||
```sh | ||
@@ -13,4 +12,3 @@ npm install hazelcast-store express-session | ||
Pass the `express-session` store into `hazelcast-store` to create a `HazelcastStore` constructor, which then creates a new Store instance to pass to express sessions. Note: since the Hazelcast Client generation is asynchronous it's a little tricky to add early in the app.use() chain. See below for a method to add the HazelcastClient to the HazelcastStore after creation. | ||
### Create an instance of `HazelcastStore` and pass it to the express sessions API: | ||
```js | ||
@@ -24,4 +22,3 @@ const session = require('express-session'); | ||
Example implementation of Hazelcast Client and setting it on the HazelcastStore | ||
### Example implementation of `HazelcastClient` and setting the client instance on the `HazelcastStore`: | ||
```js | ||
@@ -40,8 +37,7 @@ const HazelcastClient = require('hazelcast-client').Client; | ||
## Options | ||
# Options | ||
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. | ||
A full initialized Hazelcast Client is required. This client is either passed directly using the `client` param or can be added after creating the HazelcastStore using the store.addClient() method. This method is probably the easiest because the code that creates an instance of the Hazelcast client is asynchronous. | ||
The following additional properties are optional: | ||
The following additional params are optional: | ||
- `ttl` Hazelcast session TTL (expiration) in milli-seconds | ||
@@ -56,3 +52,3 @@ - `debugPrefix` prefix to use with debug module so this module's output can be seen with your app's debug output | ||
## TODO | ||
# TODO | ||
1. Custom serialization | ||
@@ -63,5 +59,3 @@ 2. Possily implement touch() method. Is express-sessions even using it any more? [Doesn't seem like it](https://github.com/expressjs/session/blob/839959036c0f6add53166f4a4d73edfc126d5ab7/session/session.js) | ||
## License | ||
# License | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16621
57