{"id":15930900,"url":"https://github.com/danielroe/ipx","last_synced_at":"2025-10-18T21:30:20.715Z","repository":{"id":40308878,"uuid":"303229872","full_name":"danielroe/ipx","owner":"danielroe","description":null,"archived":true,"fork":false,"pushed_at":"2024-04-13T08:46:32.000Z","size":577,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"use-siroc","last_synced_at":"2024-12-16T14:13:14.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/danielroe.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-10-11T23:16:20.000Z","updated_at":"2024-05-19T18:12:13.000Z","dependencies_parsed_at":"2024-01-13T16:07:57.557Z","dependency_job_id":"3c3ea91b-53fd-4412-9b92-63eb2b945633","html_url":"https://github.com/danielroe/ipx","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/danielroe%2Fipx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fipx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fipx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fipx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielroe","download_url":"https://codeload.github.com/danielroe/ipx/tar.gz/refs/heads/use-siroc","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237020588,"owners_count":19242207,"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-10-07T01:02:41.101Z","updated_at":"2025-10-18T21:30:15.383Z","avatar_url":"https://github.com/danielroe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./logo.png\" alt=\"IPX Logo\" /\u003e\n\u003c/div\u003e\n\n[![Docker Pulls](https://flat.badgen.net/docker/pulls/pooya/ipx)](https://hub.docker.com/r/pooya/ipx)\n[![NPM Vernion](https://flat.badgen.net/npm/v/ipx)](https://www.npmjs.com/package/ipx)\n[![NPM Downloads](https://flat.badgen.net/npm/dt/ipx)](https://www.npmjs.com/package/ipx)\n[![Package Size](https://flat.badgen.net/packagephobia/install/ipx)](https://packagephobia.now.sh/result?p=ipx)\n\nHigh performance, secure and easy to use image proxy based on [sharp](https://github.com/lovell/sharp) and [libvips](https://github.com/jcupitt/libvips).\n\n- Easy deployment\n- Configurable operations\n- Built-in secure cache with human readable entries and resistant against duplicates\n- Adapter based cache and input\n- Auto cache cleaner\n- Twelve factor friendly\n- Client SDK for URL generation\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n### Using NPM package\n\nYou can use `ipx` command to start server using:\n\n```bash\n$ npx ipx\n```\n\n### Docker Image\n\nLatest docker image is automatically built under [pooya/ipx](https://hub.docker.com/r/pooya/ipx).\n\nRun a test server:\n\n```bash\ndocker run \\\n  -it \\\n  --rm \\\n  --volume ./storage:/app/storage:ro \\\n  --volume ./cache:/app/cache \\\n  --port 3000:3000\n  pooya/ipx\n```\n\nUsing docker-compose:\n\n```yml\nversion: '3'\nservices:\n  ipx:\n    image: pooya/ipx\n    volumes:\n      - ./storage:/app/storage:ro\n      - ./cache:/app/cache\n    ports:\n      - 3000:3000\n```\n\n\n### Programatic Usage\n\nYou can use IPX as a Connect/Express middleware or directly use IPX class.\n\n```js\nimport { IPX, IPXMiddleware } from 'ipx'\n\nconst ipx = new IPX(/* options */)\n\nconst app = express()\napp.use('/image', IPXMiddleware(ipx))\n```\n\n\u003ch2 align=\"center\"\u003eClients\u003c/h2\u003e\n\nSee [JS Client](./packages/ipx-client/README.md) for Node.js and Browser SDK.\n\n\u003ch2 align=\"center\"\u003eAPI\u003c/h2\u003e\n\n**`/{format}/{operations}/{src}`**\n\nOperations are separated by a colon `,` (Example: `op1,op2`) and their arguments separated using underscore `_` (Example: `s_200_300`)\n\nََ‍‍Use `_` value in place for `{format}` or `{operations}` to keep original values of source image.\n\nPossible values for format: `jpeg`,`webp` or `png`.\n\n### Examples\n\nJust change format to `webp` and keep other things same as source:\n\n`http://cdn.example.com/webp/_/avatars/buffalo.png`\n\nKeep original format (`png`) and set width to `200`:\n\n`http://cdn.example.com/_/w_200/avatars/buffalo.png`\n\nResize to `200x300px` using `embed` method and change format to `jpg`:\n\n`http://cdn.example.com/jpg/s_200_300,embed/avatars/buffalo.png`\n\n\n\u003ch2 align=\"center\"\u003eOperations\u003c/h2\u003e\n\nOperation    |  Arguments            | Example     | Description\n-------------|-----------------------|-------------|---------------------------------------------------------\n`s`          | `width`, `height`     | s_200_300   | Resize image.\n`w`          | `width`               | w_200       | Change image with.\n`h`          | `height`              | h_200       | Change image height.\n`embed`      | -                     | embed       | Preserving aspect ratio, resize the image to the maximum `width` or `height` specified then embed on a background of the exact `width` and `height` specified.\n`max`        | -                     | max         | Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to the `width` and `height` specified.\n`min`        | -                     | min         | Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to the width and height specified.\n\n\u003ch2 align=\"center\"\u003eConfig\u003c/h2\u003e\n\nConfig can be customized using `IPX_*` environment variables.\n\n- `IPX_PORT` (or `PORT`)\n  Default: `3000`\n\n- `IPX_INPUT_ADAPTER`\n  - Default: `fs`\n\n- `IPX_INPUT_DIR`\n  - Default: `storage`\n\n- `IPX_CACHE_ADAPTER`\n  - Default: `fs`\n\n- `IPX_CACHE_DIR`\n  - Default: `cache`\n\n- `IPX_CACHE_CLEAN_CRON`\n  - Default: `0 0 3 * * *` (every night at 3:00 AM)\n\n- `IPX_CACHE_CLEAN_MINUTES`\n  - Default: `24 * 60` (24 hours)\n\n\u003ch2 align=\"center\"\u003eLicense\u003c/h2\u003e\n\nMIT - Pooya Parsa\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fipx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielroe%2Fipx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fipx/lists"}