Gathering detailed insights and metrics for @tusbar/cache-control
Gathering detailed insights and metrics for @tusbar/cache-control
Gathering detailed insights and metrics for @tusbar/cache-control
Gathering detailed insights and metrics for @tusbar/cache-control
npm install @tusbar/cache-control
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
41 Stars
382 Commits
8 Forks
1 Watchers
6 Branches
7 Contributors
Updated on May 30, 2025
Latest Version
1.0.2
Package Id
@tusbar/cache-control@1.0.2
Unpacked Size
56.03 kB
Size
8.69 kB
File Count
12
NPM Version
10.7.0
Node Version
20.14.0
Published on
Jun 12, 2024
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
Format and parse HTTP Cache-Control header
1$ npm install @tusbar/cache-control
This library exposes a CacheControl
class and two shortcut methods: parse()
and format()
.
parse(header)
1const {parse} = require('@tusbar/cache-control')
parse()
takes a Cache-Control
HTTP header value and returns a CacheControl
instance.
For example, parse('max-age=31536000, public')
will return
1CacheControl { 2 maxAge: 31536000, 3 sharedMaxAge: null, 4 maxStale: false, 5 maxStaleDuration: null, 6 minFresh: null, 7 immutable: false, 8 mustRevalidate: false, 9 noCache: false, 10 noStore: false, 11 noTransform: false, 12 onlyIfCached: false, 13 private: false, 14 proxyRevalidate: false, 15 public: true, 16 staleIfError: null, 17 staleWhileRevalidate: null }
format(cacheControl)
1const {format} = require('@tusbar/cache-control')
format()
takes a CacheControl
instance (or similar object) and returns a Cache-Control
HTTP header value.
For example, format({maxAge: 31536000, public: true})
will return
1max-age=31536000, public
1res.setHeader('Cache-Control', format({ 2 public: true, 3 immutable: true 4}))
Why another cache-control library?
None of the existing libraries focus on just parsing the Cache-Control
headers. There are some that expose Express (or connect-like) middlewares, and some unmaintained other ones that do rudimentary parsing of the header. The idea of this module is to parse the header according to the RFC with no further analysis or integration.
cachecontrol
: Golang HTTP Cache-Control Parser and InterpretationMIT
╚⊙ ⊙╝
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
6 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
8 existing vulnerabilities detected
Details
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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