Installations
npm install koa-generic-session-mongo
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
7.10.0
NPM Version
4.2.0
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
pavelvlasov
Download Statistics
Total Downloads
41,250
Last Day
7
Last Week
34
Last Month
94
Last Year
1,397
GitHub Statistics
37 Stars
51 Commits
16 Forks
2 Watching
1 Branches
7 Contributors
Bundle Size
462.40 kB
Minified
116.95 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.4.0
Package Id
koa-generic-session-mongo@0.4.0
Size
6.24 kB
NPM Version
4.2.0
Node Version
7.10.0
Total Downloads
Cumulative downloads
Total Downloads
41,250
Last day
-41.7%
7
Compared to previous day
Last week
0%
34
Compared to previous week
Last month
123.8%
94
Compared to previous month
Last year
15.3%
1,397
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
koa-generic-session-mongo
MongoDB store for koa-generic-session middleware backed by node-mongodb-native. Fork of connect-to-mongo store.
Installation
1 npm install koa-generic-session koa-generic-session-mongo --save
Usage
Example
1var koa = require('koa'); 2var session = require('koa-generic-session'); 3var MongoStore = require('koa-generic-session-mongo'); 4 5var app = koa(); 6app.keys = ['keys', 'keykeys']; 7app.use(session({ 8 store: new MongoStore() 9})); 10 11app.use(function *() { 12 switch (this.path) { 13 case '/get': 14 get.call(this); 15 break; 16 case '/remove': 17 remove.call(this); 18 break; 19 } 20}); 21 22function get() { 23 var session = this.session; 24 session.count = session.count || 0; 25 session.count++; 26 this.body = session.count; 27} 28 29function remove() { 30 this.session = null; 31 this.body = 0; 32} 33 34app.listen(8080);
Options
url
mongodb connection url (full connection string. host, port, db, ssl options will be ignored)db
mongodb-native database object or database name (test
by default)collection
collection name (sessions
by default)host
db hostname (127.0.0.1
by default)port
db port (27017
by default)ttl
ttl in milliseconds (if set it overrides cookiemaxAge
)user
user for MongoDBpassword
password for MongoDB authenticationssl
use SSL to connect to MongoDB (false
by default)
License
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 7/27 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Score
3.3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More