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

cloudprime

v1.1.1

Published

A versatile JavaScript Package for seamless file uploads and management using the CloudPrime, supporting images, videos, documents, presentations, spreadsheets, and all file types. Compatible with modern web and backend frameworks.

Readme

CloudPrime Documentation

The CloudPrime is a versatile JavaScript package designed for seamless file uploads and management. It integrates effortlessly with modern web and backend frameworks, providing a secure and reliable solution for handling images, videos, documents, presentations, spreadsheets, and all file types.

Features

  • Universal File Support: Upload images (JPG, PNG, GIF, WEBP), videos (MP4, MOV, AVI), documents (PDF, DOC, PPT), spreadsheets (CSV, XLSX), and any file format.
  • Secure File Uploads: Upload files with API key authentication to ensure data security.
  • Effortless Integration: Works seamlessly with React, Vue, Angular, Node.js, Express, and other frameworks.
  • File Retrieval: Retrieve uploaded files via simple API calls.
  • API Usage Tracking: Monitor your usage statistics and limits in real-time.

Getting Started

Step 1: Register and Obtain an API Key

  1. Visit the CloudPrime Platform to create your account.
  2. After registering, log in to your account and navigate to the Dashboard.
  3. Go to the API Keys section and generate your unique API key.
  4. This API key will be required for all API interactions.

Step 2: Access the Documentation

Refer to the CloudPrime Documentation for detailed information on available endpoints, request formats, and example responses.

Installation

To use the CloudPrime in your JavaScript application, install the package using npm:

npm install cloudprime

Usage Examples

Browser/React/Vue/Angular Example

import CloudPrime from 'cloudprime';

// Replace with your actual API key from CloudPrime dashboard
const API_KEY = "your_actual_api_key_here";

// Initialize the CloudPrime client
const cloudPrime = new CloudPrime(API_KEY);

// Get API usage statistics
async function getStats() {
    try {
        const stats = await cloudPrime.getUploadInfo();
        console.log("API Usage Stats:", stats);
    } catch (error) {
        console.error("Error fetching stats:", error);
    }
}

// Upload a file from file input
async function uploadFile(fileInput) {
    const file = fileInput.files[0];
    
    if (!file) {
        alert("Please select a file first!");
        return;
    }
    
    try {
        console.log(`Uploading ${file.name}...`);
        const result = await cloudPrime.uploadFile(file);
        
        console.log("Upload successful!");
        console.log("File URL:", result.data.publicUrl);
        console.log("File ID:", result.data.id);
        console.log("File Size:", result.data.fileSize);
        
        return result;
    } catch (error) {
        console.error("Upload failed:", error);
        throw error;
    }
}

// Call functions
getStats();

// Example: Trigger upload on file input change
document.getElementById('fileInput').addEventListener('change', async (e) => {
    await uploadFile(e.target);
});

Node.js Example

const CloudPrime = require('cloudprime');
const fs = require('fs').promises;

// Note: For Node.js, you'll need to handle file differently
// This example shows the concept
const API_KEY = "your_actual_api_key_here";
const cloudPrime = new CloudPrime(API_KEY);

async function nodeExample() {
    try {
        // Get usage stats
        const stats = await cloudPrime.getUploadInfo();
        console.log("API Usage Stats:", stats);
        
        // In Node.js, you would need to convert file to FormData
        // or use a different approach for file upload
        console.log("Node.js usage requires additional file handling");
    } catch (error) {
        console.error("Error:", error);
    }
}

nodeExample();

Example Response

API Usage Statistics Response:

{
    "success": true,
    "data": {
        "keyName": "Development Key",
        "isActive": true,
        "lastUsed": "2026-01-05T15:29:07.817Z",
        "usageCount": 42,
        "totalUploads": 25,
        "uploadsThisMonth": 15,
        "uploadLimit": "1000",
        "usagePercentage": 4.2,
        "createdAt": "2026-01-01T10:00:00.000Z",
        "expiresAt": "2027-01-01T10:00:00.000Z"
    }
}

File Upload Success Response:

{
    "success": true,
    "data": {
        "id": "695bd8c4f91c7ee047d11bf8",
        "publicUrl": "https://imageserve.pythonanywhere.com/media/uploads/your_uploaded_image.jpg",
        "fileSize": "1.74 MB",
        "fileName": "profile-image.jpg",
        "fileType": "image/jpeg",
        "uploadedAt": "2026-01-05T15:30:45.123Z"
    }
}

Console Output Example:

API Usage Stats: {
  success: true,
  data: {
    keyName: 'Development Key',
    isActive: true,
    lastUsed: '2026-01-05T15:29:07.817Z',
    usageCount: 42,
    totalUploads: 25,
    uploadsThisMonth: 15,
    uploadLimit: '1000',
    usagePercentage: 4.2,
    createdAt: '2026-01-01T10:00:00.000Z',
    expiresAt: '2027-01-01T10:00:00.000Z'
  }
}

Uploading presentation.pptx...
Upload successful!
File URL: https://imageserve.pythonanywhere.com/media/uploads/your_uploaded_image.pptx
File ID: 695bd8c4f91c7ee047d11bf8
File Size: 8.45 MB

Supported File Types

  • Images: .jpg, .jpeg, .png, .gif, .bmp, .webp, .svg, .tiff
  • Videos: .mp4, .avi, .mov, .mkv, .wmv, .flv, .webm
  • Documents: .pdf, .doc, .docx, .ppt, .pptx, .txt, .rtf
  • Spreadsheets: .csv, .xls, .xlsx, .ods
  • Archives: .zip, .rar, .7z, .tar.gz
  • Code Files: .js, .ts, .html, .css, .json, .xml, .py
  • Audio: .mp3, .wav, .ogg, .m4a
  • And any other file type...

Framework Integration

React Example

import React, { useState } from 'react';
import CloudPrime from 'cloudprime';

function FileUploader() {
    const [file, setFile] = useState(null);
    const [result, setResult] = useState(null);
    
    const API_KEY = "your_api_key_here";
    const cloudPrime = new CloudPrime(API_KEY);
    
    const handleFileChange = (e) => {
        setFile(e.target.files[0]);
    };
    
    const handleUpload = async () => {
        if (!file) return;
        
        try {
            const response = await cloudPrime.uploadFile(file);
            setResult(response.data);
            console.log('Upload successful:', response);
        } catch (error) {
            console.error('Upload failed:', error);
        }
    };
    
    return (
        <div>
            <input type="file" onChange={handleFileChange} />
            <button onClick={handleUpload}>Upload File</button>
            {result && (
                <div>
                    <p>File URL: <a href={result.publicUrl}>{result.publicUrl}</a></p>
                    <p>File Size: {result.fileSize}</p>
                </div>
            )}
        </div>
    );
}

Key Points

  • Keep your API key secure and never expose it in client-side code.
  • Ensure that the API key is included in the request header (X-API-Key) for authentication.
  • The package works in both browser and Node.js environments (with appropriate file handling).
  • Files are uploaded securely and stored with unique, accessible URLs.
  • Explore advanced features and additional endpoints in the CloudPrime Documentation.

Support

License

MIT License

Thank you for choosing CloudPrime for your file management needs!