Registry / storage / nv-minio-fetch

nv-minio-fetch

JSON →
library1.0.37jsnpmunverified

A thin wrapper around the MinIO Node.js client providing a simplified API for bucket and object operations. Version 1.0.37 wraps the `minio` package with convenient methods like `add`, `list`, `has`, `get`, `del` for buckets, and `add_with_file`, `add_with_ssb` for objects. It defaults to localhost:9000 credentials. The library is intended for quick scripting in Node.js, not for production use. Release cadence is irregular, and the API design relies on Promises. It does not support TypeScript natively.

npm install nv-minio-fetch
INSTALL
IMPORT
SIG · NV-MINIO-FETCH
N
nv-minio-fetch
storagejavascriptv1.0.37
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MC
const { MC } = require('nv-minio-fetch');
import { MC } from 'nv-minio-fetch';
Package is CommonJS only; ESM import will fail. Use require.
default export
const MC = require('nv-minio-fetch').MC;
const nv = require('nv-minio-fetch'); new nv();
Package does not export a default class; must destructure MC.

Shows how to create a client, add a bucket, list buckets, add an object, and delete a bucket using Promises/async.

const { MC } = require('nv-minio-fetch'); async function main() { const mc = new MC(); // default: http://127.0.0.1:9000, minioadmin/minioadmin // add bucket const bucket = await mc.add('my-bucket'); console.log('Bucket created:', bucket.name_); // list buckets const buckets = await mc.list(); console.log('Buckets:', buckets); // add object from file const obj = await bucket.add_with_file( 'test.txt', '/path/to/file.txt', { 'Content-Type': 'text/plain' } ); console.log('Object added:', obj.name_); // delete bucket const deleted = await mc.del('my-bucket'); console.log('Deleted:', deleted); } main().catch(console.error);
Debug
Known issues
gotchaDefault constructor connects to localhost:9000 with minioadmin/minioadmin; production must set env variables or modify the object.
fix
Set MINIO_ENDPOINT, MINIO_PORT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY environment variables before instantiation.
affects: all
gotchaMC constructor does not accept options; all configuration is via environment variables.
fix
Use environment variables to configure the client.
affects: >=0.1.0
deprecatedadd_with_file is deprecated; use add_with_ssb with a stream for better performance.
fix
Use bucket.add_with_ssb(stream, name, metadata)
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: MC is not a constructor
Importing the package incorrectly (e.g., using default import instead of named import).
fix
Use const { MC } = require('nv-minio-fetch');
Error: connect ECONNREFUSED 127.0.0.1:9000
MinIO server is not running on the default endpoint.
fix
Start MinIO server or set environment variables MINIO_ENDPOINT, MINIO_PORT to point to a running instance.
Upgrade
Version history
1.0.37latest on npm
Audit
Dependencies
miniorequiredcore dependency providing the MinIO client
Agent activity
30 hits · last 30 days
node
26
Amazon
1
Resources
nv-minio-fetch — npm install nv-minio-fetch · libregistry