connect-lowdb
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -73,2 +73,37 @@ const lowdbStore = (session) => { | ||
} | ||
touch(sid, session, cb) { | ||
this.set(sid, session, cb); | ||
} | ||
all(cb) { | ||
this.db.read() | ||
.then(() => { | ||
this.db.data ||= { sessions: [] }; | ||
this.db.data.sessions ||= []; | ||
cb(null, this.db.data.sessions); | ||
}) | ||
.catch((err) => { cb(err); });; | ||
} | ||
clear(cb) { | ||
this.db.data ||= { sessions: [] }; | ||
this.db.data.sessions = []; | ||
this.db.write() | ||
.then(() => { cb(null); }) | ||
.catch((err) => { cb(err); });; | ||
} | ||
length(cb) { | ||
this.db.read() | ||
.then(() => { | ||
this.db.data ||= { sessions: [] }; | ||
this.db.data.sessions ||= []; | ||
cb(null, this.db.data.sessions.length); | ||
}) | ||
.catch((err) => { cb(err); });; | ||
} | ||
} | ||
@@ -75,0 +110,0 @@ |
{ | ||
"name": "connect-lowdb", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "lowdb session store for Connect", | ||
@@ -5,0 +5,0 @@ "exports": "./index.js", |
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
6607
89