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

@mifistix-cloud/storage

v2.0.5

Published

File Storage SDK for Mifistix Cloud - Upload, download, and manage files

Readme

@mifistix-cloud/storage

File Storage SDK for Mifistix Cloud - Upload, download, and manage files.

License

This module is licensed for internal use within Mifistix only. See LICENSE for details.

Installation

npm install @mifistix-cloud/storage

Quick Start

const { initializeApp } = require('@mifistix-cloud/app');
const { getStorage, storageReference, uploadBytes, getDownloadURL, deleteObject } = require('@mifistix-cloud/storage');

// Initialize app
const app = initializeApp({
  apiKey: 'your-api-key',
  projectId: 'your-project-id',
  storageBucket: 'your-project.mifistix.storage'
});

// Get storage instance
const storage = getStorage(app);

// Create reference
const fileRef = storageReference(storage, 'images/photo.jpg');

// Upload file
const result = await uploadBytes(fileRef, fileData, {
  contentType: 'image/jpeg',
  customMetadata: 'photo'
});

// Get download URL
const url = await getDownloadURL(fileRef);
console.log('Download URL:', url);

// Delete file
await deleteObject(fileRef);

API Reference

getStorage(app)

Get storage instance.

Parameters:

  • app (Object, required): Initialized app instance

Returns: Storage service instance

storageReference(storage, filePath)

Create a reference to a file.

Parameters:

  • storage (Object): Storage instance
  • filePath (string, required): File path (validated for path traversal)

Returns: Storage reference with fullPath, name, bucket

Example:

const fileRef = storageReference(storage, 'images/photo.jpg');
console.log(fileRef.fullPath); // 'images/photo.jpg'
console.log(fileRef.name);     // 'photo.jpg'

uploadBytes(ref, data, metadata?)

Upload file to storage.

Parameters:

  • ref (Object): Storage reference
  • data (any, required): File data (string, Buffer, Blob)
  • metadata (Object, optional): File metadata

Returns: Promise with object containing ref, metadata, name, url

Example:

const result = await uploadBytes(fileRef, fileData, {
  contentType: 'image/jpeg',
  title: 'My Photo'
});
console.log('File URL:', result.url);

getDownloadURL(ref)

Get public download URL for a file.

Parameters:

  • ref (Object): Storage reference

Returns: Promise - Download URL

Example:

const url = await getDownloadURL(fileRef);

deleteObject(ref)

Delete a file from storage.

Parameters:

  • ref (Object): Storage reference

Returns: Promise

Example:

await deleteObject(fileRef);

Security Features

  • Path Traversal Protection: Validates file paths to prevent ../ attacks
  • Data Validation: Validates required parameters
  • Project Isolation: Uses project ID in all requests
  • Error Handling: Throws appropriate error types

File Metadata

When uploading, you can include metadata:

await uploadBytes(fileRef, data, {
  contentType: 'image/jpeg',
  title: 'My Photo',
  category: 'images',
  customField: 'value'
});

Download URLs

Files are accessible via public URLs:

https://api-cloud.s-mifistix.pp.ua/api/storage/public/{projectId}/{filename}

Architecture

storage/
├── src/
│   ├── core/
│   │   └── StorageClient.js     # Main storage client
│   ├── services/
│   │   └── StorageService.js    # File operations
│   ├── utils/
│   │   └── helpers.js          # Helper functions
│   ├── types/
│   │   └── index.js            # Type definitions
│   └── config/
│       └── constants.js        # Configuration constants
└── index.js

License

MIT