Gathering detailed insights and metrics for koa2-cors
Gathering detailed insights and metrics for koa2-cors
Gathering detailed insights and metrics for koa2-cors
Gathering detailed insights and metrics for koa2-cors
npm install koa2-cors
Typescript
Module System
Min. Node Version
Node Version
NPM Version
93.8
Supply Chain
90.1
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
4,472,726
Last Day
2,345
Last Week
15,715
Last Month
70,472
Last Year
884,858
238 Stars
26 Commits
13 Forks
3 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.6
Package Id
koa2-cors@2.0.6
Size
2.96 kB
NPM Version
5.6.0
Node Version
8.9.4
Publised On
17 Jul 2018
Cumulative downloads
Total Downloads
Last day
-31.5%
2,345
Compared to previous day
Last week
-3.9%
15,715
Compared to previous week
Last month
-0.9%
70,472
Compared to previous month
Last year
18.1%
884,858
Compared to previous year
it requires node v7.6.0 or higher now
1npm install --save koa2-cors
1var Koa = require('koa'); 2var cors = require('koa2-cors'); 3 4var app = new Koa(); 5app.use(cors());
Configures the Access-Control-Allow-Origin CORS header. expects a string. Can also be set to a function, which takes the ctx
as the first parameter.
Configures the Access-Control-Expose-Headers CORS header. Expects a comma-delimited array.
Configures the Access-Control-Max-Age CORS header. Expects a Number.
Configures the Access-Control-Allow-Credentials CORS header. Expects a Boolean.
Configures the Access-Control-Allow-Methods CORS header. Expects a comma-delimited array , If not specified, default allowMethods is ['GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']
.
Configures the Access-Control-Allow-Headers CORS header. Expects a comma-delimited array . If not specified, defaults to reflecting the headers specified in the request's Access-Control-Request-Headers header.
1var Koa = require('koa'); 2var cors = require('koa2-cors'); 3 4var app = new Koa(); 5app.use(cors({ 6 origin: function(ctx) { 7 if (ctx.url === '/test') { 8 return false; 9 } 10 return '*'; 11 }, 12 exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'], 13 maxAge: 5, 14 credentials: true, 15 allowMethods: ['GET', 'POST', 'DELETE'], 16 allowHeaders: ['Content-Type', 'Authorization', 'Accept'], 17})); 18...
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/25 approved changesets -- score normalized to 0
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
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
62 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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