{"id":21289278,"url":"https://github.com/chickencoding123/image-validation","last_synced_at":"2025-03-15T15:44:59.269Z","repository":{"id":57686817,"uuid":"491507251","full_name":"chickencoding123/image-validation","owner":"chickencoding123","description":"Image validation utility for DOM and Node.js beyond the file extensions","archived":false,"fork":false,"pushed_at":"2022-05-14T21:30:02.000Z","size":174,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T05:43:12.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/chickencoding123.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":"2022-05-12T12:36:27.000Z","updated_at":"2022-12-10T07:21:51.000Z","dependencies_parsed_at":"2022-09-14T07:10:22.080Z","dependency_job_id":null,"html_url":"https://github.com/chickencoding123/image-validation","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/chickencoding123%2Fimage-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickencoding123%2Fimage-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickencoding123%2Fimage-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickencoding123%2Fimage-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chickencoding123","download_url":"https://codeload.github.com/chickencoding123/image-validation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243754009,"owners_count":20342537,"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-21T12:38:03.910Z","updated_at":"2025-03-15T15:44:59.246Z","avatar_url":"https://github.com/chickencoding123.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"image-validation\n======\n\n\u003cdiv align=\"center\"\u003e\n\nImage validation utility for DOM and Node.js beyond the file extensions\n\n[![npm](https://img.shields.io/npm/v/image-validation)](https://www.npmjs.com/package/image-validation) [![License](https://img.shields.io/npm/l/image-validation)](https://github.com/chickencoding123/image-validation/blob/main/LICENSE)\n\n\n\u003c/div\u003e\n\n## Features\n- Validate images in various input formats\n- Validate based on image data instead of file extension\n- Runs in browser or [node.js](https://nodejs.org)\n- Graceful mode (optional) for failed images\n- Comes with CLI\n\n## How to use\n```sh\nnpm i image-validation\n# or\nyarn add image-validation\n```\n\n```js\nconst imageValidation = require('image-validation').default\n// or\nconst { default: imageValidation } = require('image-validation')\n// or\nimport ImageValidation from 'image-validation'\n```\nVery simple to run:\n```js\n// then\nImageValidation('image base64 string, arrays, buffer etc...')\n  .then(result =\u003e {\n    // result is either true or false\n  })\n// or\nconst result = await ImageValidation('image base64 string, arrays, buffer etc...')\n```\n\n## Configure throwing error or returning false\nBy default the validation will throw an error for an invalid/corrupt image, but this can be changed to return `false` and fail gracefully.\n```js\nconst result = await ImageValidation('image base64 string, arrays, buffer etc...', { throw: false })\n```\n\n## Why?\nAllows you to detect image corruption automatically which is very useful in workflows. Technically the image corruption must be fixed at source, but this is not always a possibility. In the future I'd like to add security scanning for metadata exploits and such.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchickencoding123%2Fimage-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchickencoding123%2Fimage-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchickencoding123%2Fimage-validation/lists"}