{"id":18665204,"url":"https://github.com/imgeng/imageengine-helpers","last_synced_at":"2025-04-11T22:30:56.448Z","repository":{"id":47777851,"uuid":"392977115","full_name":"imgeng/imageengine-helpers","owner":"imgeng","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-01T01:41:29.000Z","size":104,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-01T10:03:41.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/imgeng.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":"2021-08-05T09:09:19.000Z","updated_at":"2024-12-12T17:49:57.000Z","dependencies_parsed_at":"2022-09-26T20:02:03.875Z","dependency_job_id":"9eb0723d-c267-42ea-b56d-4cc5a875586e","html_url":"https://github.com/imgeng/imageengine-helpers","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.5,"last_synced_commit":"e9c59172bd003178da47d2f5145aff34aea61c1b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgeng%2Fimageengine-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgeng%2Fimageengine-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgeng%2Fimageengine-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgeng%2Fimageengine-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imgeng","download_url":"https://codeload.github.com/imgeng/imageengine-helpers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489510,"owners_count":21112587,"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-07T08:26:41.106Z","updated_at":"2025-04-11T22:30:55.269Z","avatar_url":"https://github.com/imgeng.png","language":"TypeScript","readme":"A tiny set of helpers and TS types for building [ImageEngine](https://imageengine.io) query URLs for your distribution.\n\nThese set of utilities only make sense if you want to use an object to declare your [directives](https://support.imageengine.io/hc/en-us/articles/360058880672-directives) for when retrieving assets from an ImageEngine distribution.\n\nInstall it with:\n\n`npm install @imageengine/imageengine-helpers`\n\nView on [npm](https://www.npmjs.com/package/@imageengine/imageengine-helpers)\n\nTypes:\n\n```\nexport type IEFormat =\n    \"png\"  |\n    \"gif\"  |\n    \"jpg\"  |\n    \"bmp\"  |\n    \"webp\" |\n    \"jp2\"  |\n    \"svg\"  |\n    \"mp4\"  |\n    \"jxr\"  |\n    \"avif\" \n    \"jxl\"  ;\n\n\nexport type IEFit =\n    \"stretch\"   |\n    \"box\"       |\n    \"letterbox\" |\n    \"cropbox\"   |\n    \"outside\"   ;\n\n\nexport interface IEDirectives {\n    width?: number;                // the intrinsic width of the final image \n    height?: number;               // the intrinsic height of the final image\n    auto_width_fallback?: number;  // if WURFL device detection should be tried with a\n                                   // fallback value in case it fails\n\n    scale_to_screen_width?: number;          // 0-100 float\n    crop?: [number, number, number, number]; // [width, height, left, top]\n\n    format?: IEFormat;  // the output format\n    fit?: IEFit;        // the image fit in relation to the provided width/height\n\n    compression?: number; // 0-100\n    sharpness?: number;   // 0-100\n    rotate?: number;      // -360-360\n\n    inline?: true;                 // convert image to dataURL\n    keep_meta?: true;              // keep EXIF image data\n    no_optimization?: true;        // don't apply IE optimizations\n    force_download?: true;\n    max_device_pixel_ratio: 2.1;   // 1-4 float\n};\n```\n\nFor instance:\n\n```js\nimport { build_IE_url, build_IE_directives, build_IE_query_string } from \"imageengine-helpers\";\n\nlet directives: IEDirectives = {\n    width: 400,\n    height: 200,\n    fit: \"cropbox\", \n    compression: 10,\n    inline: true,\n    format: \"png\",\n    force_download: true,\n    max_device_pixel_ratio: 2.1\n};\n\nlet source_url: string = \"https://my_ie_distribution.imgeng.io/path/to_asset1.jpg\";\n\nlet final_url: string = build_IE_url(source_url, directives);\n\n/*\n\"https://my_ie_distribution.imgeng.io/path/to_asset1.jpg?imgeng=/w_400/h_200/m_cropbox/cmpr_10/in_true/f_png/dl_true\"\n*/\n\nlet directives_string: string = build_IE_directives(directives);\n\n/*\n\"/w_400/h_200/m_cropbox/cmpr_10/in_true/f_png/dl_true\"\n*/\n\nlet query_string: string = build_IE_query_string(directives);\n\n/*\n\"?imgeng=/w_400/h_200/m_cropbox/cmpr_10/in_true/f_png/dl_true\"\n*/\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgeng%2Fimageengine-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimgeng%2Fimageengine-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgeng%2Fimageengine-helpers/lists"}