Socket
Socket
Sign inDemoInstall

cloudi-upload-with-ease

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudi-upload-with-ease

upload to cloudinary with ease


Version published
Weekly downloads
15
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

Cloudinary File Upload Utility for Node.js

License Node.js npm

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.

Installation

npm install cloudi-upload-with-ease

Usage

Import the utility functions

const {
  uploadToCloudinary,
  uploadSingleOrMultiImagesToClodinary,
} = require('cloudi-upload-with-ease');
import {
  uploadToCloudinary,
  uploadSingleOrMultiImagesToClodinary,
} from 'cloudi-upload-with-ease';

Configuration

Before using the utility functions, make sure to configure Cloudinary with your credentials.

const config = {
  cloudinary_cloud_name: 'your_cloud_name',
  cloudinary_api_key: 'your_api_key',
  cloudinary_api_secret: 'your_api_secret',
};

Upload a Single File

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);
  });

Upload Single or Multiple Files

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);
  });

License

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Cloudinary - Cloud-based image and video management service.

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

Author

This package is authored by Olaoluwa Daniel IBUKUN.

Keywords

FAQs

Package last updated on 17 Jan 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc