{"id":21611303,"url":"https://github.com/runnerty/executor-image","last_synced_at":"2025-03-18T16:04:40.613Z","repository":{"id":49043644,"uuid":"279401907","full_name":"runnerty/executor-image","owner":"runnerty","description":"Runnerty module: Image executor","archived":false,"fork":false,"pushed_at":"2022-04-14T17:21:48.000Z","size":771,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T20:15:53.950Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/runnerty.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":"2020-07-13T20:12:16.000Z","updated_at":"2022-02-05T18:11:41.000Z","dependencies_parsed_at":"2022-09-09T02:51:27.062Z","dependency_job_id":null,"html_url":"https://github.com/runnerty/executor-image","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Fexecutor-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runnerty","download_url":"https://codeload.github.com/runnerty/executor-image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257279,"owners_count":20424131,"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-24T21:11:54.319Z","updated_at":"2025-03-18T16:04:40.579Z","avatar_url":"https://github.com/runnerty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://runnerty.io\"\u003e\n    \u003cimg height=\"257\" src=\"https://runnerty.io/assets/header/logo-stroked.png\"\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003eSmart Processes Management\u003c/p\u003e\n\u003c/p\u003e\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]\n\u003ca href=\"#badge\"\u003e\n\u003cimg alt=\"code style: prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\"\u003e\n\u003c/a\u003e\n\n# Executor for [Runnerty]: Image\n\nModule for image processing, conversion and optimization.\nIt makes use of the [sharp] and [imagemin] (image optimization) modules.\nIt supports `JPG`, `PNG`, `WEBP`, `SVG`, `HEIF`, `TIFF` and `RAW` formats and allows the optimization of `JPG` (mozjpeg), `PNG` (pngquant), `WEBP` and `SVG`.\n\n### Installation:\n\nThrough NPM\n\n```bash\nnpm i @runnerty/executor-image\n```\n\nYou can also add modules to your project with [runnerty]\n\n```bash\nnpx runnerty add @runnerty/executor-image\n```\n\nThis command installs the module in your project, adds example configuration in your [config.json] and creates an example plan of use.\n\nIf you have installed [runnerty] globally you can include the module with this command:\n\n```bash\nrunnerty add @runnerty/executor-image\n```\n\n### Configuration:\n\nAdd in [config.json]:\n\n```json\n{\n  \"id\": \"image_default\",\n  \"type\": \"@runnerty-executor-image\"\n}\n```\n\n### Plan sample:\n\nAdd in [plan.json]:\n\n```json\n{\n  \"id\": \"image_default\",\n  \"input\": [\"/workspace/*.png\"],\n  \"destination\": \"/workspace/resized\",\n  \"resize\": { \"width\": 1500 }\n}\n```\n\n```json\n{\n  \"id\": \"image_default\",\n  \"input\": [\"/workspace/*.{jpg,jpeg}\"],\n  \"destination\": \"/workspace/optimized\",\n  \"optimized\": true,\n  \"quality\": 75\n}\n```\n\n```json\n{\n  \"id\": \"image_default\",\n  \"input\": [\"workspace/the_image.png\"],\n  \"destination\": \"/workspace/transformed\",\n  \"resize\": { \"height\": 800 },\n  \"rotate\": 90,\n  \"flip\": true,\n  \"flop\": true,\n  \"negate\": false,\n  \"greyscale\": false,\n  \"sharpen\": true,\n  \"toFormat\": \"jpg\",\n  \"optimized\": true,\n  \"quality\": 80,\n  \"flatten\": { \"background\": \"#2abb81\" },\n  \"tint\": \"#2abb81\",\n  \"failOnError\": true\n}\n```\n\n```json\n{\n  \"id\": \"image_default\",\n  \"input\": [\"workspace/*.png\"],\n  \"destination\": \"/workspace/watermark\",\n  \"overrideDestinationFilename\": \"customname\",\n  \"destinationPrefixFilename\": \"pre_\",\n  \"destinationSuffixFilename\": \"_sub\",\n  \"toFormat\": \"webp\",\n  \"optimized\": true,\n  \"composite\": [{ \"input\": \"/workspace/runnerty.png\", \"gravity\": \"center\", \"blend\": \"soft-light\" }]\n}\n```\n\nUse parameters in [toFormat]:\n\n```json\n{\n  \"id\": \"image_default\",\n  \"input\": [\"workspace/*.png\"],\n  \"destination\": \"/workspace/watermark\",\n  \"toFormat\": { \"toFormat\": \"webp\", \"quality\": 80, \"alphaQuality\": 90, \"lossless\": false }\n}\n```\n\n### Output (Process values):\n\n- `PROCESS_EXEC_MSG_OUTPUT`: Log operations message.\n- `PROCESS_EXEC_ERR_OUTPUT`: Error output message.\n\n### Other considerations\n\nFor more information see [sharp]'s documentation.\n\nIf you enable the `failOnError` parameter, the process will stop when any error occurs transforming or optimizing an image.\nThis may be recommended if you are only going to work on a single image at a time.\nBy default its value is false.\n\n[runnerty]: https://www.runnerty.io\n[downloads-image]: https://img.shields.io/npm/dm/@runnerty/executor-image.svg\n[npm-url]: https://www.npmjs.com/package/@runnerty/executor-image\n[npm-image]: https://img.shields.io/npm/v/@runnerty/executor-image.svg\n[sharp]: https://sharp.pixelplumbing.com\n[imagemin]: https://github.com/imagemin/imagemin\n[toformat]: https://sharp.pixelplumbing.com/api-output#toformat\n[config.json]: http://docs.runnerty.io/config/\n[plan.json]: http://docs.runnerty.io/plan/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnerty%2Fexecutor-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunnerty%2Fexecutor-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnerty%2Fexecutor-image/lists"}