{"id":13779961,"url":"https://github.com/koajs/snapshot","last_synced_at":"2025-07-06T04:32:26.003Z","repository":{"id":18128026,"uuid":"21206751","full_name":"koajs/snapshot","owner":"koajs","description":"take snapshot when request, cache by request path. ","archived":false,"fork":false,"pushed_at":"2022-02-12T05:34:54.000Z","size":14,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-30T04:31:08.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koajs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-25T14:45:50.000Z","updated_at":"2024-07-19T23:54:51.000Z","dependencies_parsed_at":"2022-09-24T22:02:30.759Z","dependency_job_id":null,"html_url":"https://github.com/koajs/snapshot","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/koajs/snapshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fsnapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fsnapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fsnapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fsnapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koajs","download_url":"https://codeload.github.com/koajs/snapshot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Fsnapshot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263567480,"owners_count":23481568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:01:10.942Z","updated_at":"2025-07-06T04:32:25.983Z","avatar_url":"https://github.com/koajs.png","language":"JavaScript","readme":"snapshot\n----------\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Coveralls][coveralls-image]][coveralls-url]\n[![David deps][david-image]][david-url]\n[![node version][node-image]][node-url]\n[![npm download][download-image]][download-url]\n[![Gittip][gittip-image]][gittip-url]\n\n[npm-image]: https://img.shields.io/npm/v/koa-snapshot.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-snapshot\n[travis-image]: https://img.shields.io/travis/koajs/snapshot.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koajs/snapshot\n[coveralls-image]: https://img.shields.io/coveralls/koajs/snapshot.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/koajs/snapshot?branch=master\n[david-image]: https://img.shields.io/david/koajs/snapshot.svg?style=flat-square\n[david-url]: https://david-dm.org/koajs/snapshot\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.11-red.svg?style=flat-square\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/koa-snapshot.svg?style=flat-square\n[download-url]: https://npmjs.org/package/koa-snapshot\n[gittip-image]: https://img.shields.io/gittip/dead-horse.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/dead-horse/\n\ntake snapshot when request, cache by request path.\n\n## Install\n\n```\nnpm install koa-snapshot\n```\n\n## Usage\n\n```\nvar koa = require('koa');\nvar snapshot = require('koa-snapshot');\nvar app = koa();\n\napp.use(snapshot());\n\n```\n\n## Options\n\nUse your own cache client by `options.cache`.\nIf do not present `options.cache`, snapshot will create a [lru-cache](https://github.com/isaacs/node-lru-cache) instance with the options.\n\ndefault options for lru-cache:\n\n```\n{\n  max: 50 * 1024 * 1024,  // 50mb\n  maxAge: 12 * 60 * 60 * 1000,  // 12h\n  length: function (n) {\n    return n.length;\n  }\n}\n```\n\n## Turn off Snapshot\n\nYou can manually turn off snapshot by set `this.noSnapshot = true` in every request.\n\n## License\n\nMIT\n","funding_links":[],"categories":["Middleware"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoajs%2Fsnapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoajs%2Fsnapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoajs%2Fsnapshot/lists"}