convert-url-to-image
v1.0.2
Published
Convert an image URL into a File object
Downloads
31
Maintainers
Readme
📦 convert-url-to-image
Convert an image URL into a downloadable
Fileobject – perfect for file uploads from pasted image links in React apps.
🚀 Installation
npm install convert-url-to-image
```md
## 📖 Description
This utility helps you convert a public image URL (like from clipboard or user input) into a JavaScript `File` object. It’s useful for simulating an image upload from a pasted link, especially in form-based applications.
## 🛠️ Usage
### Example in React:
```jsx
import { ConvertUrlToImage } from 'convert-url-to-image';
<input
type="text"
placeholder="Paste image URL"
onChange={async (e) => {
const file = await ConvertUrlToImage(e.target.value);
if (file) {
// Use the file as you want
}
}}
/>
---
## 🧑💻 Author
Made with ❤️ by [Nitesh Yadav](https://github.com/nk7318
Full-stack developer | Open source enthusiast | React & Node.js lover
---
## 📃 License
MIT © 2025 [Nitesh Yadav](https://github.com/nk7318)
