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

@pulasthiabishake/mediastore

v1.0.1

Published

JavaScript/TypeScript SDK for MediaStore file storage service with automatic image optimization

Readme

MediaStore JavaScript SDK

npm version License: MIT

Modern JavaScript/TypeScript SDK for MediaStore - Fast file storage with automatic image optimization and variant generation.

✨ Features

  • 🚀 Fast & Modern: Built with TypeScript, works everywhere
  • 📦 Lightweight: Minimal dependencies
  • 🖼️ Auto Image Variants: Automatic thumbnail, medium, and large sizes
  • 🔐 Secure: API key authentication
  • 🌐 Universal: Works in Node.js and browsers (with bundler)
  • 📘 TypeScript: Full type definitions included
  • Parallel Processing: Powered by Go backend with goroutines

📦 Installation

npm

npm install @pulasthiabishake/mediastore

yarn

yarn add @pulasthiabishake/mediastore

🚀 Quick Start

const { MediaStore } = require('@pulasthiabishake/mediastore');

const client = new MediaStore('sk_live_your_api_key');
const files = await client.files.list();

// Upload a file const file = await client.files.upload('./photo.jpg'); console.log('✓ Uploaded:', file.url); console.log('✓ Variants:', file.variants);

// List files const files = await client.files.list(); console.log('✓ Total files:', files.length);

// Get account info const account = await client.account.get(); console.log(✓ Storage: ${account.storage_used_mb} MB);


### TypeScript
```typescript
import { MediaStore } from '@abhishke391/mediastore';
import type { File, Account } from '@abhishke391/mediastore';

const client = new MediaStore({
  apiKey: 'sk_live_your_api_key',
  baseUrl: 'http://localhost:8080'
});

const file: File = await client.files.upload('./photo.jpg');
const account: Account = await client.account.get();

ES Modules

import { MediaStore } from '@abhishke391/mediastore';

const client = new MediaStore('sk_live_your_api_key');
const files = await client.files.list();

📖 API Documentation

Constructor

// Simple initialization
const client = new MediaStore('your_api_key');

// With custom configuration
const client = new MediaStore({
  apiKey: 'your_api_key',
  baseUrl: 'https://api.mediastore.com'
});

Files API

Upload

const file = await client.files.upload(fileOrPath);
// Returns: { id, original_name, url, variants, size_mb, type, uploaded_at }

List

const files = await client.files.list();
// Returns: Array of file objects

Get

const file = await client.files.get(fileId);

Rename

const file = await client.files.rename(fileId, 'new-name.jpg');

Delete

await client.files.delete(fileId);

Account API

Get Info

const account = await client.account.get();
// Returns: { email, storage_used_mb, storage_limit_mb, storage_percentage }

Get Stats

const stats = await client.account.stats();
// Returns: { total_files, total_images, total_documents, largest_file, ... }

API Keys API

List

const keys = await client.keys.list();

Create

const key = await client.keys.create('Production Key');

Rename

await client.keys.rename(keyId, 'New Name');

Revoke

await client.keys.revoke(keyId);

🔧 Configuration

interface MediaStoreConfig {
  apiKey: string;        // Required: Your MediaStore API key
  baseUrl?: string;      // Optional: API base URL (default: http://localhost:8080)
}

📝 TypeScript Support

Full TypeScript support with exported types:

import type {
  MediaStoreConfig,
  File,
  Account,
  APIKey,
  UsageStats
} from '@abhishke391/mediastore';

🌐 Browser Usage

Works in browsers with bundlers (Webpack, Vite, Rollup):

import { MediaStore } from '@abhishke391/mediastore';

const client = new MediaStore('sk_live_your_api_key');

// Upload from file input
const fileInput = document.querySelector('input[type="file"]');
const file = await client.files.upload(fileInput.files[0]);

// Display with variants
img.src = file.variants.thumbnail;

🔗 Related Projects

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT © Abhishke391

🐛 Issues

Found a bug? Please open an issue.

⭐ Show Your Support

Give a ⭐️ if this project helped you!