{"id":19085573,"url":"https://github.com/theritikchoure/image-processing-using-sharp","last_synced_at":"2026-04-12T07:32:37.759Z","repository":{"id":245728486,"uuid":"819069919","full_name":"theritikchoure/image-processing-using-sharp","owner":"theritikchoure","description":"This repository contains a simple Express server designed to handle image uploads and convert them to various formats (jpeg, png, webp) using the Sharp image processing library. ","archived":false,"fork":false,"pushed_at":"2024-06-23T17:41:48.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T21:47:03.691Z","etag":null,"topics":["express","file-upload","image-processing","multer","nodejs","sharp"],"latest_commit_sha":null,"homepage":"","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/theritikchoure.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,"publiccode":null,"codemeta":null}},"created_at":"2024-06-23T17:32:00.000Z","updated_at":"2024-06-23T17:44:49.000Z","dependencies_parsed_at":"2024-06-23T18:47:03.932Z","dependency_job_id":"bd0024f0-3d5f-40c4-874e-79a4315fcab5","html_url":"https://github.com/theritikchoure/image-processing-using-sharp","commit_stats":null,"previous_names":["theritikchoure/image-processing-using-sharp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Fimage-processing-using-sharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Fimage-processing-using-sharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Fimage-processing-using-sharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Fimage-processing-using-sharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theritikchoure","download_url":"https://codeload.github.com/theritikchoure/image-processing-using-sharp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240136981,"owners_count":19753645,"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":["express","file-upload","image-processing","multer","nodejs","sharp"],"created_at":"2024-11-09T02:56:38.584Z","updated_at":"2025-10-25T01:36:24.964Z","avatar_url":"https://github.com/theritikchoure.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Converter API\n\nThis repository provides a simple Express server for converting image formats using Sharp. The server allows users to upload an image and convert it to a desired format (jpeg, png, webp) via an HTTP endpoint.\n\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [Code Flow](#code-flow)\n- [How to Use](#how-to-use)\n- [Example Request](#example-request)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\n1. **Clone the repository:**\n\n   ```sh\n   git clone https://github.com/your-username/image-converter-api.git\n   cd image-converter-api\n    ```\n\n2. **Install the dependencies:**\n\n    ```sh\n    npm install\n    ```\n\n## Usage\n\nTo start the server, run:\n\n    ```sh\n    npm run dev\n    ```\n\nThe server will start and listen on port 3000 by default. You can access it at http://localhost:3000.\n\n## Code Flow\n\n1. **Server Setup:**\n\n- An Express server is created and configured to listen on port 3000.\n- Multer is configured to handle file uploads, storing them temporarily in the OS temp directory.\n- The uploads directory is created if it doesn't already exist.\n\n2. **Route for Image Conversion:**\n\n- The /convert endpoint is set up to accept image uploads.\n- The desired format for the image conversion is taken from the request body.\n- Sharp processes the uploaded image and converts it to the specified format.\n- The converted image is saved to the uploads directory.\n- The server responds with the converted image file and cleans up temporary files.\n\n## How to Use\n\n1. **Send a Request to Convert an Image:**\n\nUse an HTTP client like `Postman` or `curl` to send a `POST` request to `http://localhost:3000/convert` with the image file and the desired format.\n\nExample using curl:\n\n    ```sh\n    curl -F \"image=@path_to_your_image_file\" -F \"format=jpeg\" \"http://localhost:3000/convert\"\n    ```\n\nReplace `path_to_your_image_file` with the path to your image file and `jpeg` with the desired format (`jpeg`, `png`, `webp`).\n\n## Example Request\nTo convert an image to PNG format:\n\n    ```sh\n    curl -F \"image=@/path/to/image.jpg\" -F \"format=png\" \"http://localhost:3000/convert\"\n    ```\nThis will return the converted image as a downloadable file.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any bugs or feature requests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheritikchoure%2Fimage-processing-using-sharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheritikchoure%2Fimage-processing-using-sharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheritikchoure%2Fimage-processing-using-sharp/lists"}