{"id":21184379,"url":"https://github.com/ifyoumakeit/parcel-plugin-prefetch","last_synced_at":"2025-03-14T19:46:53.602Z","repository":{"id":68736325,"uuid":"122872236","full_name":"ifyoumakeit/parcel-plugin-prefetch","owner":"ifyoumakeit","description":"Simple JSON to prefetch data in bundle. ","archived":false,"fork":false,"pushed_at":"2018-02-25T21:37:06.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T01:11:50.146Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ifyoumakeit.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":"2018-02-25T20:11:53.000Z","updated_at":"2018-02-25T20:12:21.000Z","dependencies_parsed_at":"2023-03-17T13:01:14.027Z","dependency_job_id":null,"html_url":"https://github.com/ifyoumakeit/parcel-plugin-prefetch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifyoumakeit%2Fparcel-plugin-prefetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifyoumakeit%2Fparcel-plugin-prefetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifyoumakeit%2Fparcel-plugin-prefetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifyoumakeit%2Fparcel-plugin-prefetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ifyoumakeit","download_url":"https://codeload.github.com/ifyoumakeit/parcel-plugin-prefetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639402,"owners_count":20323505,"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-11-20T18:01:26.452Z","updated_at":"2025-03-14T19:46:53.579Z","avatar_url":"https://github.com/ifyoumakeit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parcel-plugin-prefetch\n\nWrite some JSON to prefetch data in bundle. \n\n## How to use\n\n`yarn add parcel-plugin-prefetch`\n\n1. Create JSON file with extension `.jsonpf`\n2. JSON should be a list in the format...\n```json\n[{\n  \"key\": \"foo\",\n  \"url\": \"https://...\"\n}]\n```\n3. Add `import {foo, STATES} from \"./data.jsonpf\"` to the top of file.\n4. `yarn parcel index.html` or whatever you use.\n5. Parcel will prefetch the data and return data in below format.\n```js\n{\n  foo: {\n    key: \"foo\",\n    url: \"https://...\",\n    state: \"FETCHING\" // FAILED || FETCHED\n    data: {} // Data returned if \"FETCHED\"\n    error: Error // Error returned if \"FAILED\"  \n  },\n  // States for comparison.\n  STATES: { \n    FETCHING: \"FETCHING\",\n    FETCHED: \"FETCHED\",\n    FAILURE: \"FAILURE\"\n  }\n}\n```\n\n## Missing data?\nTry running with `--no-cache`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifyoumakeit%2Fparcel-plugin-prefetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fifyoumakeit%2Fparcel-plugin-prefetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifyoumakeit%2Fparcel-plugin-prefetch/lists"}