Gathering detailed insights and metrics for @types/koa-redis-cache
Gathering detailed insights and metrics for @types/koa-redis-cache
Gathering detailed insights and metrics for @types/koa-redis-cache
Gathering detailed insights and metrics for @types/koa-redis-cache
The repository for high quality TypeScript type definitions.
npm install @types/koa-redis-cache
Typescript
Module System
67.5
Supply Chain
97.5
Quality
75.4
Maintenance
100
Vulnerability
100
License
TypeScript (99.84%)
JavaScript (0.15%)
Shell (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
50,041 Stars
89,745 Commits
30,435 Forks
640 Watchers
6 Branches
9,957 Contributors
Updated on Jul 15, 2025
Latest Version
3.0.4
Package Id
@types/koa-redis-cache@3.0.4
Unpacked Size
7.28 kB
Size
2.26 kB
File Count
5
Published on
Nov 07, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
npm install --save @types/koa-redis-cache
This package contains type definitions for koa-redis-cache (https://github.com/coderhaoxin/koa-redis-cache).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-redis-cache.
1import * as Koa from "koa"; 2import * as Redis from "redis"; 3 4type onErrorCallback = (error: Error) => void; 5 6type getPrefixCallback = (ctx: Koa.Context) => string; 7 8declare namespace cache { 9 interface CacheOptions { 10 /** 11 * redis key prefix, default is koa-redis-cache: 12 * If a function is supplied, its signature should be function(ctx) {} and it should return a string to use as the redis key prefix 13 */ 14 prefix?: string | getPrefixCallback | undefined; 15 16 /** 17 * redis expire time (second), default is 30 * 60 (30 min) 18 */ 19 expire?: number | undefined; 20 21 /** 22 * if the passParam exists in the query string, skip the cache 23 */ 24 passParam?: string | undefined; 25 26 /** 27 * max length of body size (in bytes) to cache. 28 * if the size of the body exceeds maxLength, the body will not be cached. 29 * default is: Infinity 30 */ 31 maxLength?: number | undefined; 32 33 /** 34 * the routes to cache, default is ['(.*)']. 35 * can be set to an array of routes (string), or an array of RouteOptions 36 */ 37 routes?: RouteOptions[] | string[] | undefined; 38 39 /** 40 * the routes to exclude, default is []. 41 * example: ['/api/(.*)', '/view/:id'] 42 */ 43 exclude?: string[] | undefined; 44 45 /** 46 * callback function for error, default is function() {} 47 */ 48 onerror?: onErrorCallback | undefined; 49 50 /** 51 * redis options 52 */ 53 redis?: RedisOptions | undefined; 54 } 55 56 interface RouteOptions { 57 /** 58 * the route to cache, example: '/api/(.*)' 59 */ 60 route: string; 61 62 /** 63 * expiration time in seconds for cached responses for the route 64 */ 65 expire?: number | undefined; 66 } 67 68 interface RedisOptions { 69 /** 70 * host name of the redis server, default: 'localhost' 71 */ 72 host?: string | undefined; 73 74 /** 75 * port number of the redis server, default: 6379 76 */ 77 port?: number | undefined; 78 79 /** 80 * node_redis options 81 */ 82 options?: Redis.ClientOpts | undefined; 83 } 84} 85 86declare function cache(opts?: cache.CacheOptions): Koa.Middleware; 87 88export = cache; 89
These definitions were written by Dima Mukhin.
No vulnerabilities found.
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 27/30 approved changesets -- score normalized to 9
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 8
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-14
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