{"id":13726022,"url":"https://github.com/nitish24p/react-worker-image","last_synced_at":"2025-05-07T21:31:02.158Z","repository":{"id":57347825,"uuid":"120094779","full_name":"nitish24p/react-worker-image","owner":"nitish24p","description":"React component to fetch image resources via web workers 🤖🤖","archived":false,"fork":false,"pushed_at":"2018-06-22T08:31:02.000Z","size":1866,"stargazers_count":232,"open_issues_count":14,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-11T22:13:08.659Z","etag":null,"topics":["image","performance","react","web-worker"],"latest_commit_sha":null,"homepage":"","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/nitish24p.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-02-03T13:44:22.000Z","updated_at":"2024-01-28T13:03:05.000Z","dependencies_parsed_at":"2022-08-28T01:40:20.761Z","dependency_job_id":null,"html_url":"https://github.com/nitish24p/react-worker-image","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/nitish24p%2Freact-worker-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitish24p%2Freact-worker-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitish24p%2Freact-worker-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitish24p%2Freact-worker-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitish24p","download_url":"https://codeload.github.com/nitish24p/react-worker-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224616560,"owners_count":17341151,"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":["image","performance","react","web-worker"],"created_at":"2024-08-03T01:02:48.102Z","updated_at":"2024-11-14T16:33:08.295Z","avatar_url":"https://github.com/nitish24p.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# react-worker-image\n[![Build Status](https://travis-ci.org/nitish24p/react-worker-image.svg?branch=master)](https://travis-ci.org/nitish24p/react-worker-image)\nReact component to fetch image resources via web workers\n\n[react-worker-image](https://www.npmjs.com/package/react-worker-image) is a React component for loading images via a web worker. Thereby not blocking the main thread and speeding up page load time.\n\n## Installation\nUsing npm\n\n```bash\nnpm install react-worker-image\n\nyarn add react-worker-image\n```\n\n## Usage\n\n`react-worker-image` exports one react component which takes `src` as a prop, and an optional prop of `placeholder`, `style` and `imageClass` which are applied to the img tag.\n\n```js\nconst ImageWorker = require('react-worker-image').default;\n\nor\n\nimport ImageWorker from 'react-worker-image';\n\n```\nusage in code\n```jsx\n\u003cImageWorker src='http://image-url' /\u003e\n```\n\n## Props List\n\n\n| Prop type        | Required           | type  |\n| ------------- |:-------------:| --------------:|\n| src      | yes |  string |\n| placeholder      | optional      |   string or Component|\n| style | optional     |    Object |\n|imageClass | optional | string\n|containerClass | optional | string\n\nThe above props are applied to the img tag.\n\nFound a bug file them [here](https://github.com/nitish24p/react-worker-image/issues).\n\n\u003eComponent in Action\n\nObserve the page Load time at the bottom right corner in both cases.\n\nThe first is via a webworker and the second is the regular get.\n\n\u003cimg src=\"./screen/screen.gif\"\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitish24p%2Freact-worker-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitish24p%2Freact-worker-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitish24p%2Freact-worker-image/lists"}