{"versions":{"1.0.0":{"name":"cache-control-esm","public":true,"version":"1.0.0","description":"Format and parse HTTP Cache-Control header","main":"index.js","module":"index.js","scripts":{"test":"nyc ava"},"keywords":["cache-control","http","rfc7234"],"repository":{"type":"git","url":"git+https://github.com/rascarlito/cache-control.git"},"authors":["Bertrand Marron <bertrand.marron@gmail.com>","Carl Ogren <rascarlito@gmail.com>"],"license":"MIT","devDependencies":{"ava":"^1.0.1","codecov":"^3.0.0","lerna-changelog":"0.8.2","nyc":"^14.0.0","xo":"^0.24.0"},"nyc":{"reporter":["lcov","text"]},"xo":{"semicolon":false,"space":2},"changelog":{"cacheDir":".changelog","labels":{"bug":":bug: Bug Fix","build":":building_construction: Build Process","cleanup":":shower: Cleanup","documentation":":memo: Documentation","enhancement":":rocket: Enhancement","performance":":racehorse: Performance","security":":policeman: Security"},"repo":"tusbar/cache-control"},"gitHead":"1b311d4039f6cc92775e0efec3ec424eb21653c9","bugs":{"url":"https://github.com/rascarlito/cache-control/issues"},"homepage":"https://github.com/rascarlito/cache-control#readme","_id":"cache-control-esm@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.1","_npmUser":{"name":"anonymous","email":"rascarlito@gmail.com"},"dist":{"shasum":"417647ecf1837a5e74155f55d5a4ae32a84e2581","size":3269,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/cache-control-esm/-/cache-control-esm-1.0.0.tgz","integrity":"sha512-Fa3UV4+eIk4EOih8FTV6EEsVKO0W5XWtNs6FC3InTfVz+EjurjPfDXY5wZDo/lxjDxg5RjNcurLyxEJBcEUx9g=="},"maintainers":[{"name":"anonymous","email":"rascarlito@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-control-esm_1.0.0_1558421817214_0.002095207925729925"},"_hasShrinkwrap":false,"publish_time":1558421817331,"_cnpm_publish_time":1558421817331,"_cnpmcore_publish_time":"2021-12-16T11:21:58.592Z","contributors":[]}},"dist-tags":{"latest":"1.0.0"},"name":"cache-control-esm","time":{"created":"2022-01-27T07:12:11.399Z","modified":"2023-05-13T08:43:32.500Z","1.0.0":"2019-05-21T06:56:57.331Z"},"readme":"# cache-control\n\n> Format and parse HTTP Cache-Control header\n\n:warning: This is a fork of the original [`@tusbar/cache-control`](https://github.com/tusbar/cache-control) package.\n\nThis package uses `export default` instead of `module.exports` to expose the code and was specifically modified to be\nbundled by [`axios-cache-adapter`](https://github.com/rascarlito/axios-cache-adapter).\n\n## Getting started\n\n```bash\n$ npm install @rascarlito/cache-control\n```\n\n## API\n\nThis library exposes a `CacheControl` class and two shortcut methods: `parse()` and `format()`.\n\n### `parse(header)`\n\n```js\nimport { parse } from '@rascarlito/cache-control'\n```\n\n`parse()` takes `Cache-Control` HTTP header value and returns a `CacheControl` instance.\n\nFor example, `parse('max-age=31536000, public')` will return\n\n```js\nCacheControl {\n  maxAge: 31536000,\n  sharedMaxAge: null,\n  maxStale: false,\n  maxStaleDuration: null,\n  minFresh: null,\n  immutable: false,\n  mustRevalidate: false,\n  noCache: false,\n  noStore: false,\n  noTransform: false,\n  onlyIfCached: false,\n  private: false,\n  proxyRevalidate: false,\n  public: true\n}\n```\n\n### `format(cacheControl)`\n\n```js\nimport { format } from '@rascarlito/cache-control'\n```\n\n`format()` takes a `CacheControl` instance (or similar object) and returns a `Cache-Control` HTTP header value.\n\nFor example, `format({maxAge: 31536000, public: true})` will return\n\n```js\nmax-age=31536000, public\n```\n\n## Example usage\n\n```js\nres.setHeader('Cache-Control', format({\n  public: true,\n  immutable: true\n}))\n```\n\n## FAQ\n\n**Why another cache-control library?**\n\nNone 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.\n\n\n## See also\n\n- [`cachecontrol`](https://github.com/pquerna/cachecontrol): Golang HTTP Cache-Control Parser and Interpretation\n\n\n## License\n\nMIT\n\n\n## Miscellaneous\n\n```\n    ╚⊙ ⊙╝\n  ╚═(███)═╝\n ╚═(███)═╝\n╚═(███)═╝\n ╚═(███)═╝\n  ╚═(███)═╝\n   ╚═(███)═╝\n```","users":{}}