{"id":15397442,"url":"https://github.com/scaccogatto/sharp-resizer-server","last_synced_at":"2026-02-22T09:33:30.989Z","repository":{"id":98592526,"uuid":"102850947","full_name":"scaccogatto/sharp-resizer-server","owner":"scaccogatto","description":"an automatic node-based image resizer server, with frontend-friendly API","archived":false,"fork":false,"pushed_at":"2017-09-18T09:30:50.000Z","size":13,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T08:32:09.879Z","etag":null,"topics":["node","resize-images","server","sharp","watch"],"latest_commit_sha":null,"homepage":"","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/scaccogatto.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":"2017-09-08T10:42:33.000Z","updated_at":"2020-02-19T09:52:40.000Z","dependencies_parsed_at":"2023-03-15T21:31:06.461Z","dependency_job_id":null,"html_url":"https://github.com/scaccogatto/sharp-resizer-server","commit_stats":{"total_commits":2,"total_committers":2,"mean_commits":1.0,"dds":0.5,"last_synced_commit":"957e7d8432c33d5a3a6d97263beeed0d7dee40ee"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scaccogatto/sharp-resizer-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fsharp-resizer-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fsharp-resizer-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fsharp-resizer-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fsharp-resizer-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scaccogatto","download_url":"https://codeload.github.com/scaccogatto/sharp-resizer-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fsharp-resizer-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29708359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T05:59:28.568Z","status":"ssl_error","status_checked_at":"2026-02-22T05:58:46.208Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["node","resize-images","server","sharp","watch"],"created_at":"2024-10-01T15:38:05.750Z","updated_at":"2026-02-22T09:33:30.968Z","avatar_url":"https://github.com/scaccogatto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sharp-resizer-server\n\u003e an automatic node-based image resizer server, with frontend-friendly API\n\n## Install and Run\n1. `git clone git@github.com:scaccogatto/sharp-resizer-server.git`\n2. `cd sharp-resizer-server`\n3. `npm install`\n4. `npm run start`\n\n## Start resizing\n- After installation, everytime you add a new folder inside `input`, a **watcher** will be started, listening to any change\n- The folder's name should be a `Number` and it will be treated as a `px` value multiplied for `19.20` by default and scaled downwards the other folders inside `input`\n- Add images inside your preferred folder and the server will scale downwards automatically\n- Open a browser and call `localhost:4080/images/json`\n\n## Output\nThe API entry point (`images/json`) will output a JSON file ready for your frontend usage.\nThe output format is:\n```\n{\n  \"bigImage.jpg\": {\n    \"sizes\": \"100w\",\n    \"srcset\": \"/images/output/100/bigImage.jpg 100w, /images/output/72/bigImage.jpg 72w, /images/output/37/bigImage.jpg 37w, /images/output/26/bigImage.jpg 26w, /images/output/16/bigImage.jpg 16w\",\n    \"src\": \"/images/output/100/bigImage.jpg\"\n  },\n  \"mediumImage.jpg\": {\n    \"sizes\": \"37w\",\n    \"srcset\": \"/images/output/37/mediumImage.jpg 37w, /images/output/26/mediumImage.jpg 26w, /images/output/16/mediumImage.jpg 16w\",\n    \"src\": \"/images/output/37/mediumImage.jpg\"\n  },\n}\n```\nAn `Object` containing images' names as keys and every key is an `Object` containing:\n- `sizes`: the greatest width found for that file\n- `srcset`: a string for `\u003cpicture\u003e` TAGs, ready for use\n- `src`: for image fallback\n## Example\nTree:\n```\ninput\n--| 100\n--| 72\n--| 37\n--| 26\n--| 16\n\noutput\n--| 100\n--| 72\n--| 37\n--| 26\n--| 16\n```\nAdd an image into `100` folder\n```\ninput\n--| 100\n  | -- bigImage.png\n--| 72\n--| 37\n--| 26\n--| 16\n\noutput\n--| 100\n  | -- bigImage.png\n--| 72\n  | -- bigImage.png\n--| 37\n  | -- bigImage.png\n--| 26\n  | -- bigImage.png\n--| 16\n  | -- bigImage.png\n```\nAdd an image into `37` folder\n```\ninput\n--| 100\n  | -- bigImage.png\n--| 72\n--| 37\n  | -- mediumImage.png\n--| 26\n--| 16\n\noutput\n--| 100\n  | -- bigImage.png\n--| 72\n  | -- bigImage.png\n--| 37\n  | -- bigImage.png\n  | -- mediumImage.png\n--| 26\n  | -- bigImage.png\n  | -- mediumImage.png\n--| 16\n  | -- bigImage.png\n  | -- mediumImage.png  \n```\nLet's print the **bigImage** then, **after** reading things from API:\n```\n\u003cpicture\u003e\n  \u003csource sizes=\"100w\" srcset=\"/images/output/100/bigImage.jpg 100w, /images/output/72/bigImage.jpg 72w, /images/output/37/bigImage.jpg 37w, /images/output/26/bigImage.jpg 26w, /images/output/16/bigImage.jpg 16w\",\n    \"src\": \"/images/output/100/bigImage.jpg\" /\u003e\n  \u003cimg src=\"/images/output/100/bigImage.jpg\" /\u003e\n\u003c/picture\u003e\n```\n\n## Advanced\n### Script parameters\nYou can also specify some script parameters such as:\n- `-i` input directory\n- `-o` output directory\n- `-m` pixel multipllier (when `m = 1920` folder `100` -\u003e `1920px`)\n- `-t` maximum concurrent conversion threads\n- `-p` API local server port\n- `-e` API entry point\n\n### Defaults\n`node index.js -i input -o output -m 1920 -t 1 -p 4080 -e images`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaccogatto%2Fsharp-resizer-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscaccogatto%2Fsharp-resizer-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaccogatto%2Fsharp-resizer-server/lists"}