A Node.js utility for easy file uploads to Cloudinary. Simplify the process of uploading images and videos with two convenient functions: uploadToCloudinary
and
uploadSingleOrMultiImagesToCloudinary
.
npm install cloudi-upload-with-ease
const {
uploadToCloudinary,
uploadSingleOrMultiImagesToClodinary,
} = require('cloudi-upload-with-ease');
import {
uploadToCloudinary,
uploadSingleOrMultiImagesToClodinary,
} from 'cloudi-upload-with-ease';
const config = {
cloudinary_cloud_name: 'your_cloud_name',
cloudinary_api_key: 'your_api_key',
cloudinary_api_secret: 'your_api_secret',
};
const file = '/path/to/your/file.jpg'; // Provide the path to your file
const type = 'image'; // Specify the type: 'image', 'video', 'raw', 'auto', etc.
uploadToCloudinary(file, type, config)
.then((response) => {
console.log('File uploaded successfully:', response);
})
.catch((error) => {
console.error('Error uploading file:', error);
});
const files = [
{ path: '/path/to/image1.jpg' },
{ path: '/path/to/image2.jpg' },
// ... add more files as needed
];
const type = 'image'; // Specify the type: 'image', 'video', 'raw', 'auto', etc.
uploadSingleOrMultiImagesToClodinary(files, type, config)
.then((response) => {
console.log('Files uploaded successfully:', response);
})
.catch((error) => {
console.error('Error uploading files:', error);
});
This project is licensed under the MIT License - see the LICENSE file for details.
Cloudinary - Cloud-based image and video management service.
Contributions are welcome! Please feel free to open an issue or submit a pull request.
This package is authored by Olaoluwa Daniel IBUKUN.