Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redisess

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redisess - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

23

lib/SessionManager.js

@@ -119,5 +119,3 @@ const crypto = require('crypto');

(n ? Math.floor(this._now() - n) : '-inf'), '+inf')
.then(resp => {
return Number(resp);
});
.then(resp => Number(resp));
});

@@ -127,2 +125,21 @@ }

/**
* Retrieves session count of single user which were active within the last n seconds.
*
* @param {string} userId
* @param {number} [n=10]
* @return {Promise<Array<String>>}
*/
countForUser(userId, n) {
if (!userId)
return Promise.reject(new ArgumentError('You must provide userId'));
return this._getClient().then(client => {
n = Number(n);
const prefix = this._ns + ':' + this._appName;
return client.zcount(prefix + ':user_' + userId,
(n ? Math.floor(this._now() - n) : '-inf'), '+inf')
.then(resp => Number(resp));
});
}
/**
* Creates new session

@@ -129,0 +146,0 @@ *

2

package.json
{
"name": "redisess",
"description": "Powerful redis session manager for NodeJS",
"version": "0.3.0",
"version": "0.4.0",
"author": "Panates Ltd.",

@@ -6,0 +6,0 @@ "contributors": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc