{"id":19859055,"url":"https://github.com/mikedevelops/cache-resources","last_synced_at":"2026-06-24T02:31:19.880Z","repository":{"id":144062903,"uuid":"83422715","full_name":"mikedevelops/cache-resources","owner":"mikedevelops","description":"Cache resources from a JSON file with Javascript","archived":false,"fork":false,"pushed_at":"2017-03-02T11:48:43.000Z","size":277,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T23:58:38.327Z","etag":null,"topics":["es6","frontend","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikedevelops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-28T11:03:56.000Z","updated_at":"2017-02-28T13:46:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"42fb250f-c9ce-40f6-817e-e76a7f94d840","html_url":"https://github.com/mikedevelops/cache-resources","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mikedevelops/cache-resources","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedevelops%2Fcache-resources","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedevelops%2Fcache-resources/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedevelops%2Fcache-resources/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedevelops%2Fcache-resources/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikedevelops","download_url":"https://codeload.github.com/mikedevelops/cache-resources/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikedevelops%2Fcache-resources/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34714992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["es6","frontend","javascript"],"created_at":"2024-11-12T14:25:30.676Z","updated_at":"2026-06-24T02:31:19.853Z","avatar_url":"https://github.com/mikedevelops.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cache Resources\n\nA small ES6 module to cache front end image assets (audo \u0026 video coming soon). Made to work in tandem with the webpack plugin [FileCatalogue](https://github.com/mikedevelops/file-catalogue). The plugin parses a JSON file and creates a reference in the browser's cache to each asset.\n\n### Installation\n\n`npm install --save mikedevelops/cache-resources`\n\n\n### Usage\n\n``` javascript\nimport CacheResources from 'cache-resources'\n\nconst cache = new CacheResources({\n    filename: 'assets.json',\n    test: /\\.(jpg|png|svg|jpeg)$/,\n    complete: function (assets) {\n        console.log('cached assets!')\n    }\n})\n```\n\n### Options\n\n----\n\n`filename: [String] (default: 'assets.json')`\n\nThe JSON file to be requested for asset parsing, you will need to manually create this file and place it in your build directory, or use this plugin to do it for you [FileCatalogue](https://github.com/mikedevelops/file-catalogue).\n\n----\n\n`test: [RegExp] (default: /\\.(jpg|jpeg|png|svg|gif|mp4)$/)`\n\nA regular expression to execute against each file to determine if it should be cached or skipped.\n\n----\n\n### Caveats\n\nI've not extensively tested this in all browsers, it's currently built to work in the latest Chrome 56 build. I'll be adding additional support down the line as and when it's needed. Feel free to create a Pull Request to add additional support.\n\n### Coming Soon\n\n- Audio file caching\n- Video file caching\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikedevelops%2Fcache-resources","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikedevelops%2Fcache-resources","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikedevelops%2Fcache-resources/lists"}