
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
cool-react-image-upload
Advanced tools
cool react library for uploading images. this is cloned from react-image-upload npm module with some additional features
Cool React Image Upload is a comprehensive React component designed for handling image uploads with features like file type filtering and file size validation. It provides an easy integration for any React application and offers extensive customization options.
The starter code for this node module was cloned from git@github.com:chimdie/react-image-upload.git.
You can install the package using npm or yarn:
npm:
npm install cool-react-image-upload
yarn:
yarn add cool-react-image-upload
Below is a simple example to demonstrate how to integrate the Cool React Image Upload into your project:
import React, { useState } from 'react';
import CoolImageUploader from 'cool-react-image-upload';
function App() {
const [imageData, setImageData] = useState('');
const handleOnFileAdded = (file) => {
setImageData(file.dataUrl);
};
const handleOnFileRemoved = () => {
setImageData('');
};
const handleOnError = (errMsg) => {
console.error("An error occurred: " + errMsg);
}
return (
<div>
<CoolImageUploader
onFileAdded={handleOnFileAdded}
onFileRemoved={handleOnFileRemoved}
imageData={imageData}
onImageChange={setImageData}
acceptedFileTypes="image/jpeg,image/png"
maxFileSize={1000000} // 1MB max file size
style={{
height: '150px',
width: '150px',
borderRadius: '10px'
}}
btnWrapperStyle={{
top: '10px',
right: '10px'
}}
onError={handleOnError}
/>
</div>
);
}
export default App;
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This project is licensed under the MIT License - see MIT License for details.
FAQs
cool react library for uploading images. this is cloned from react-image-upload npm module with some additional features
The npm package cool-react-image-upload receives a total of 1 weekly downloads. As such, cool-react-image-upload popularity was classified as not popular.
We found that cool-react-image-upload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.