{"id":15364055,"url":"https://github.com/murongg/image2file","last_synced_at":"2026-03-01T14:32:32.021Z","repository":{"id":62355044,"uuid":"508601052","full_name":"murongg/image2file","owner":"murongg","description":"Simple image / svg / psd / file convert.","archived":false,"fork":false,"pushed_at":"2022-07-02T03:02:48.000Z","size":138,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T06:45:40.013Z","etag":null,"topics":["convert","file","gif","jpeg","jpg","png","psd","svg"],"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/murongg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["murongg"]}},"created_at":"2022-06-29T08:04:03.000Z","updated_at":"2023-09-14T01:35:23.000Z","dependencies_parsed_at":"2022-10-31T10:45:20.956Z","dependency_job_id":null,"html_url":"https://github.com/murongg/image2file","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/murongg/image2file","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murongg%2Fimage2file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murongg%2Fimage2file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murongg%2Fimage2file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murongg%2Fimage2file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/murongg","download_url":"https://codeload.github.com/murongg/image2file/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murongg%2Fimage2file/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29970981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T14:11:48.712Z","status":"ssl_error","status_checked_at":"2026-03-01T14:11:48.352Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["convert","file","gif","jpeg","jpg","png","psd","svg"],"created_at":"2024-10-01T13:09:48.481Z","updated_at":"2026-03-01T14:32:31.986Z","avatar_url":"https://github.com/murongg.png","language":"TypeScript","funding_links":["https://github.com/sponsors/murongg"],"categories":[],"sub_categories":[],"readme":"# image2file\n\n[![NPM version](https://img.shields.io/npm/v/image2file?color=a1b858\u0026label=)](https://www.npmjs.com/package/image2file)\n\n## 📎 Installation\n```sh\n$ npm install image2file\n```\n## 👽 Usage\n\n```js\nimport { imageToBase64 } from 'image2file'\n```\n\n## ✈️ Functions\n\n### Image Functions\n| name                      | description                    |\n| ------------------------- | ------------------------------ |\n| `imageDataToFile`         | ImageData to File              |\n| `imageElementToFile`      | HTMLImageElement to File       |\n| `imageDataToImageElement` | ImageData to HTMLImageElement  |\n| `imageToBase64`           | Image to Base64                |\n| `imageToImageElement`     | Image file to HTMLImageElement |\n| `imageFileToBase64`       | Image file to Base64           |\n| `imageToSvg`              | Image to SVG                   |\n| `imageFileToSvg`          | Image file to SVG              |\n\n### SVG Functions\n| name                | description            |\n| ------------------- | ---------------------- |\n| `svgToBase64`       | SVG to svg base64      |\n| `svgFileToBase64`   | SVG File to SVG Base64 |\n| `svgToImageElement` | SVG to ImageElement    |\n| `svgToImageBase64`  | SVG to image base64    |\n| `svgToImageFile`    | SVG to image file      |\n\n### PSD Functions\n| name                | description             |\n| ------------------- | ----------------------- |\n| `psdToImageFile`    | PSD to image file       |\n| `psdToImageElement` | PSD to HTMLImageElement |\n| `psdToImageData`    | PSD to ImageData        |\n| `psdToBase64`       | PSD to Base64           |\n| `psdToSvg`          | PSD to SVG              |\n\n### Other Functions\n| name                   | description                |\n| ---------------------- | -------------------------- |\n| `fileToBase64`         | File to Base64             |\n| `blobToArrayBuffer`    | Blob to ArrayBuffer        |\n| `base64ToFile`         | Base64 to File             |\n| `base64ToImageElement` | Base64 to HTMLImageElement |\n\n## Type Declares\n\n```ts\nfunction generateFileReader\u003cT\u003e(source: File | Blob): Promise\u003cT | undefined | null\u003e\nfunction fileToBase64\u003cT = string\u003e(source: File): Promise\u003cT | null | undefined\u003e\nfunction blobToArrayBuffer\u003cT = ArrayBuffer\u003e(source: Blob): Promise\u003cT | null | undefined\u003e\nfunction base64ToFile(base64: string, filename: string): File\nfunction base64ToImageElement(base64: string): HTMLImageElement\nfunction imageDataToFile(imageData: ImageData, filename: string, fileType?: string, quality?: number): Promise\u003cFile\u003e\nfunction imageElementToFile(imageEl: HTMLImageElement, filename: string, fileType?: string, quality?: number): Promise\u003cFile\u003e\nfunction imageDataToImageElement(imageData: ImageData, fileType?: string, quality?: number): Promise\u003cHTMLImageElement\u003e\nfunction imageToImageElement(imageFile: File): Promise\u003cHTMLImageElement | undefined\u003e\nfunction imageToBase64(image: ImageData | HTMLImageElement, fileType?: string, quality?: number): Promise\u003cstring\u003e\nfunction imageFileToBase64(imageFile: File): Promise\u003cstring | null | undefined\u003e\nfunction imageToSvg(image: string): Promise\u003cstring\u003e\nfunction imageFileToSvg(imageFile: File): Promise\u003cstring | undefined\u003e\nfunction psdToImageFile(file: File, fileType?: string, quality?: number): Promise\u003cFile\u003e\nfunction psdToImageElement(file: File, fileType?: string, quality?: number): Promise\u003cHTMLImageElement\u003e\nfunction psdToImageData(file: File): Promise\u003cImageData\u003e\nfunction psdToBase64(file: File, fileType?: string, quality?: number): Promise\u003cstring\u003e\nfunction psdToSvg(file: File, fileType?: string, quality?: number): Promise\u003cstring\u003e\nfunction svgToBase64(file: File | SVGElement): Promise\u003cstring | null | undefined\u003e | undefined\nfunction svgFileToBase64(file: File): Promise\u003cstring | null | undefined\u003e | undefined\nfunction svgElementToBase64(file: SVGElement): Promise\u003cstring | null | undefined\u003e | undefined\nfunction svgToImageElement(file: File): Promise\u003cHTMLImageElement | undefined\u003e\nfunction svgToImageBase64(file: File, fileType?: string, quality?: number): Promise\u003cstring | undefined\u003e\nfunction svgToImageFile(file: File, fileType?: string, quality?: number): Promise\u003cFile | undefined\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurongg%2Fimage2file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurongg%2Fimage2file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurongg%2Fimage2file/lists"}