sessionstore
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -8,13 +8,12 @@ 'use strict'; | ||
// get express version | ||
var file = path.join(__dirname, '/..', 'node_modules', 'express', 'package.json'); | ||
var exists = fs.existsSync(file); | ||
var expressPkg; | ||
if (!exists) { | ||
try { | ||
expressPkg = require('express/package.json'); | ||
} catch (err) { | ||
throw new Error('No express found.'); | ||
} | ||
// read out major version | ||
var buffer = fs.readFileSync(file); | ||
var version = JSON.parse(buffer).version.split('.')[0]; | ||
version = parseInt(version); | ||
var version = parseInt(expressPkg.version.split('.')[0], 10); | ||
@@ -24,6 +23,7 @@ if (version < 4) { | ||
} else if (version === 4) { | ||
file = path.join(__dirname, '/..', 'node_modules', 'express-session', 'package.json'); | ||
exists = fs.existsSync(file); | ||
var expressSessPkg; | ||
if (!exists) { | ||
try { | ||
expressSessPkg = require('express-session/package.json'); | ||
} catch (err) { | ||
throw new Error('No express-session found.'); | ||
@@ -30,0 +30,0 @@ } |
{ | ||
"author": "adrai", | ||
"name": "sessionstore", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -97,2 +97,3 @@ # Introduction | ||
# License | ||
@@ -99,0 +100,0 @@ |
@@ -30,3 +30,3 @@ var expect = require('expect.js'), | ||
describe('an existing db implementation of redis', function(done) { | ||
describe('an existing db implementation of redis', function() { | ||
it('it should return a new store', function() { | ||
@@ -37,3 +37,3 @@ var store = sessionStore.createSessionStore({ type: 'redis' }); | ||
it('it should set and get a session', function() { | ||
it('it should set and get a session', function(done) { | ||
sessionStore.createSessionStore({ type: 'redis' }, function(err, store){ | ||
@@ -71,3 +71,3 @@ // #set() | ||
describe('an existing db implementation of memcached', function(done) { | ||
describe('an existing db implementation of memcached', function() { | ||
it('it should return a new store', function() { | ||
@@ -78,3 +78,3 @@ var store = sessionStore.createSessionStore({ type: 'memcached' }); | ||
it('it should set and get a session', function() { | ||
it('it should set and get a session', function(done) { | ||
sessionStore.createSessionStore({ type: 'memcached' }, function(err, store) { | ||
@@ -81,0 +81,0 @@ // #set() |
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
118
31506
715