Socket
Socket
Sign inDemoInstall

minio

Package Overview
Dependencies
Maintainers
4
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minio

S3 Compatible Cloud Storage client


Version published
Weekly downloads
207K
decreased by-0.62%
Maintainers
4
Weekly downloads
 
Created

What is minio?

The MinIO npm package is a client library for interacting with MinIO and Amazon S3 compatible cloud storage services. It allows developers to perform a variety of operations such as uploading, downloading, and managing data in object storage.

What are minio's main functionalities?

Initialize MinIO Client

This code initializes a MinIO client instance with the necessary configuration such as endpoint, port, SSL usage, access key, and secret key.

const Minio = require('minio');

const minioClient = new Minio.Client({
  endPoint: 'play.min.io',
  port: 9000,
  useSSL: true,
  accessKey: 'Q3AM3UQ867SPQQA43P2F',
  secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
});

Upload an Object

This code uploads a file from the local filesystem to a specified bucket in the MinIO server.

minioClient.fPutObject('my-bucket', 'my-object', '/path/to/file', function(err, etag) {
  if (err) return console.log(err);
  console.log('File uploaded successfully.');
});

Download an Object

This code downloads an object from a specified bucket in the MinIO server to the local filesystem.

minioClient.fGetObject('my-bucket', 'my-object', '/path/to/destination', function(err) {
  if (err) return console.log(err);
  console.log('File downloaded successfully.');
});

List Objects in a Bucket

This code lists all objects in a specified bucket. It uses a stream to handle the data and errors.

var stream = minioClient.listObjects('my-bucket', '', true);
stream.on('data', function(obj) { console.log(obj); });
stream.on('error', function(err) { console.log(err); });

Remove an Object

This code removes a specified object from a bucket in the MinIO server.

minioClient.removeObject('my-bucket', 'my-object', function(err) {
  if (err) return console.log(err);
  console.log('Object removed successfully.');
});

Other packages similar to minio

Keywords

FAQs

Package last updated on 01 Sep 2023

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