npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@onlineapps/storage-core

v1.0.12

Published

Core MinIO storage operations for OA Drive - shared by business and infrastructure services

Downloads

110

Readme

@onlineapps/storage-core

Core MinIO storage operations for OA Drive - shared by business and infrastructure services.

Purpose

This package provides basic storage operations without business-specific features (caching, shared URLs, logging). It is used by:

  • Business services via @onlineapps/conn-base-storage (which adds business features)
  • Infrastructure services via @onlineapps/infrastructure-tools (which re-exports this package)

Installation

npm install @onlineapps/storage-core

Quick Start

const { StorageCore } = require('@onlineapps/storage-core');

const storage = new StorageCore({
  // FAIL-FAST: topology must be explicit (no defaults for hosts/credentials)
  endPoint: process.env.MINIO_ENDPOINT,
  port: parseInt(process.env.MINIO_PORT, 10),
  accessKey: process.env.MINIO_ACCESS_KEY,
  secretKey: process.env.MINIO_SECRET_KEY
});

await storage.initialize();

// Upload
await storage.putObject('bucket', 'path/to/file', buffer, {
  'Content-Type': 'application/json'
});

// Download
const buffer = await storage.getObject('bucket', 'path/to/file');

// Fingerprint
const fingerprint = storage.calculateFingerprint(buffer);

API

Constructor

const storage = new StorageCore(config);

Config options:

  • endPoint - MinIO server endpoint (required, env: MINIO_ENDPOINT)
  • port - MinIO server port (required, env: MINIO_PORT)
  • useSSL - Use SSL/TLS (default: false)
  • accessKey - Access key (required, env: MINIO_ACCESS_KEY)
  • secretKey - Secret key (required, env: MINIO_SECRET_KEY)

Core Methods

initialize()

Initialize storage client (currently a no-op, kept for API consistency).

bucketExists(bucket)

Check if bucket exists.

ensureBucket(bucket, region?)

Ensure bucket exists, create if it doesn't.

putObject(bucket, path, data, metadata?)

Upload object to storage.

getObject(bucket, path)

Download object from storage.

objectExists(bucket, path)

Check if object exists.

statObject(bucket, path)

Get object metadata.

deleteObject(bucket, path)

Delete object from storage.

calculateFingerprint(content)

Generate SHA256 fingerprint for content (string, Buffer, or Object).

verifyFingerprint(bucket, path, expectedFingerprint)

Download object and verify its fingerprint matches expected value.

getContentType(filename)

Get MIME type from filename extension.

getPresignedUrl(bucket, path, expiry?)

Generate presigned URL for object access.

listByPrefix(bucket, prefix?, recursive?)

List objects by prefix.

Architecture

storage-core (this package)
    ↓
conn-base-storage (business services)
    + business features (caching, shared URLs, logging)

storage-core (this package)
    ↓
infrastructure-tools (infrastructure services)
    + re-export for infra services

Error Messages

All errors follow the format: [StorageCore] Problem - Expected/Fix

Example:

[StorageCore] putObject: bucket name is required
[StorageCore] Fingerprint mismatch: expected abc123, got def456

Dependencies

  • minio - MinIO client library

No other external dependencies - minimal footprint.

License

ISC