
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
cache-control-parser
Advanced tools
A lightweight cache-control parser.
To use cache-control-parser in your project, run:
npm install cache-control-parser
import cacheControlParser from "cache-control-parser";
const cacheControl = cacheControlParser(
"public, max-age=86400, no-transform"
);
console.log(cacheControl);
Output:
{
"isPublic": true,
"maxAge": 86400,
"noTransform": true
}
Supported cache-control directives:
{
maxAge?: number;
sharedMaxAge?: number;
staleWhileRevalidate?: number;
staleIfError?: number;
isPublic?: boolean;
isPrivate?: boolean;
noStore?: boolean;
noCache?: boolean;
mustRevalidate?: boolean;
proxyRevalidate?: boolean;
immutable?: boolean;
noTransform?: boolean;
}
Type definitions are included in this library and exposed via:
import { CacheControl } from "cache-control-parser";
When contributing to this project, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Update the README.md with details of changes to the library.
Execute yarn test and update the tests if needed.
Run the full test suite:
yarn test
Run tests in watch mode:
yarn test:watch
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A humble cache-control parser
The npm package cache-control-parser receives a total of 89,842 weekly downloads. As such, cache-control-parser popularity was classified as popular.
We found that cache-control-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.