{"id":20980505,"url":"https://github.com/hyperjumptech/strapi-optimized-image","last_synced_at":"2026-02-23T16:34:49.642Z","repository":{"id":256376504,"uuid":"855075681","full_name":"hyperjumptech/strapi-optimized-image","owner":"hyperjumptech","description":"Retrieve optimized image from Strapi","archived":false,"fork":false,"pushed_at":"2024-09-10T10:49:21.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-23T07:22:57.372Z","etag":null,"topics":["cms","image","optimization","strapi"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@hyperjumptech/strapi-optimized-image","language":"TypeScript","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/hyperjumptech.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2024-09-10T09:06:08.000Z","updated_at":"2024-09-10T11:13:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"ffd55884-2a94-4805-85ac-a4dc283c4d70","html_url":"https://github.com/hyperjumptech/strapi-optimized-image","commit_stats":null,"previous_names":["hyperjumptech/strapi-optimized-image"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hyperjumptech/strapi-optimized-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fstrapi-optimized-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fstrapi-optimized-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fstrapi-optimized-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fstrapi-optimized-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperjumptech","download_url":"https://codeload.github.com/hyperjumptech/strapi-optimized-image/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fstrapi-optimized-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29748234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cms","image","optimization","strapi"],"created_at":"2024-11-19T05:28:56.431Z","updated_at":"2026-02-23T16:34:49.617Z","avatar_url":"https://github.com/hyperjumptech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Strapi Optimized Image\n\nRetrieve optimized image from [Strapi](https://strapi.io/).\n\n## Quick Start\n\n### Install\n\n```sh\nnpm i --save-exact @hyperjumptech/strapi-optimized-image\n```\n\n### Usage\n\n```typescript\nimport {\n  PreferredSize,\n  strapiOptimizedImage,\n} from \"@hyperjumptech/strapi-optimized-image\";\n\nconst formats = {\n  thumbnail: {\n    height: 180,\n    url: \"https://example.com/logo_thumbnail.svg\",\n    width: 320,\n  },\n  small: {\n    height: 225,\n    url: \"https://example.com/logo_small.svg\",\n    width: 400,\n  },\n  large: {\n    height: 900,\n    url: \"https://example.com/logo_large.svg\",\n    width: 1600,\n  },\n};\nconst { height, src, width } = strapiOptimizedImage({\n  image: {\n    formats,\n    height: 720,\n    url: \"https://example.com/logo.svg\",\n    width: 1280,\n  },\n  fallback: \"smaller\",\n  preferredSize: PreferredSize.Medium,\n});\n\nconsole.log({ height, src, width });\n// { height: 225, src: \"https://example.com/logo_small.svg\", width: 400 }\n```\n\n| Props         | Default Value | Description                                                                                                                       | Example                                                          |\n| ------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| image         | `undefined`   | The image object structure from the Strapi API response                                                                           | `{ formats, height: 100, url: \"/uploads/logo.svg\", width: 100 }` |\n| fallback      | \"original\"    | Uses the original size of the image if set to `\"original\"`. Tries to find a smaller image if set to `\"smaller\"`.                  | `\"original\" / \"smaller\"`                                         |\n| preferredSize | \"large\"       | Attempts to use the preferred size. If unavailable, it will use the original or a smaller image, depending on the fallback value. | `\"thumbnail\" / \"small\" / \"medium\" / \"large\"`                     |\n\n## License\n\nThe MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjumptech%2Fstrapi-optimized-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperjumptech%2Fstrapi-optimized-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjumptech%2Fstrapi-optimized-image/lists"}