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

@weirdlookingjay/uploadme-node

v1.0.1

Published

Node.js SDK for UploadMe file upload service

Readme

@uploadme/node

Node.js SDK for UploadMe file upload service. Perfect for server-side file uploads, backend integrations, and automation scripts.

Installation

npm install @weirdlookingjay/uploadme-node
# or
yarn add @weirdlookingjay/uploadme-node
# or
pnpm add @weirdlookingjay/uploadme-node

Quick Start

const { UploadMeClient } = require('@weirdlookingjay/uploadme-node');

// Initialize client
const client = new UploadMeClient({
  apiKey: 'your-api-key-here',
  apiUrl: 'http://localhost:4000/api/v1', // Optional, defaults to production
});

// Upload a file
async function uploadFile() {
  const file = await client.uploadFile('./image.jpg', {
    onProgress: (progress) => {
      console.log(`Upload progress: ${progress.percentage}%`);
    },
  });

  console.log('Uploaded:', file.url);
}

uploadFile();

Features

  • File Upload - From file path, buffer, or stream
  • Progress Tracking - Real-time upload progress
  • File Management - List, get, delete files
  • File Download - Download files to local disk
  • TypeScript Support - Full type definitions
  • Error Handling - Comprehensive error messages
  • Async/Await - Modern promise-based API

API Reference

Initialize Client

const client = new UploadMeClient({
  apiKey: 'your-api-key-here',
  apiUrl: 'http://localhost:4000/api/v1', // Optional
});

Upload Methods

Upload from File Path

const file = await client.uploadFile('./document.pdf', {
  onProgress: (progress) => {
    console.log(`${progress.percentage}% complete`);
  },
});

Upload from Buffer

const buffer = fs.readFileSync('./image.png');
const file = await client.uploadBuffer(buffer, 'image.png', {
  onProgress: (progress) => console.log(progress),
});

Upload from Stream

const stream = fs.createReadStream('./video.mp4');
const stats = fs.statSync('./video.mp4');

const file = await client.uploadStream(stream, 'video.mp4', stats.size, {
  onProgress: (progress) => console.log(progress),
});

File Management

List Files

const result = await client.listFiles({
  page: 1,
  limit: 20,
  search: 'image',
});

console.log(`Total files: ${result.total}`);
result.files.forEach((file) => {
  console.log(`- ${file.originalName} (${file.size} bytes)`);
});

Get File Details

const file = await client.getFile('file-id-here');
console.log(file);

Delete File

await client.deleteFile('file-id-here');
console.log('File deleted');

Download File

await client.downloadFile('file-id-here', './downloaded-file.jpg');
console.log('File downloaded');

TypeScript Support

Full TypeScript definitions included:

import { UploadMeClient, UploadedFile, UploadProgress } from '@weirdlookingjay/uploadme-node';

const client = new UploadMeClient({
  apiKey: process.env.UPLOADME_API_KEY!,
});

const file: UploadedFile = await client.uploadFile('./image.jpg');

Examples

Upload Multiple Files

const files = ['image1.jpg', 'image2.jpg', 'image3.jpg'];

for (const filePath of files) {
  const file = await client.uploadFile(filePath);
  console.log(`Uploaded: ${file.originalName}`);
}

Upload with Progress Bar

const cliProgress = require('cli-progress');

const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
progressBar.start(100, 0);

const file = await client.uploadFile('./large-file.zip', {
  onProgress: (progress) => {
    progressBar.update(progress.percentage);
  },
});

progressBar.stop();
console.log('Upload complete!');

Batch Upload with Error Handling

async function batchUpload(filePaths) {
  const results = [];

  for (const filePath of filePaths) {
    try {
      const file = await client.uploadFile(filePath);
      results.push({ success: true, file });
    } catch (error) {
      results.push({ success: false, error: error.message, filePath });
    }
  }

  return results;
}

const results = await batchUpload(['file1.jpg', 'file2.pdf', 'file3.png']);
console.log(results);

Download All Files

async function downloadAllFiles(outputDir) {
  const { files } = await client.listFiles({ limit: 100 });

  for (const file of files) {
    const outputPath = path.join(outputDir, file.originalName);
    await client.downloadFile(file.id, outputPath);
    console.log(`Downloaded: ${file.originalName}`);
  }
}

await downloadAllFiles('./downloads');

Error Handling

try {
  const file = await client.uploadFile('./image.jpg');
} catch (error) {
  if (error.response) {
    // API error
    console.error('API Error:', error.response.data.error.message);
  } else if (error.request) {
    // Network error
    console.error('Network Error:', error.message);
  } else {
    // Other error
    console.error('Error:', error.message);
  }
}

Environment Variables

# .env
UPLOADME_API_KEY=your-api-key-here
UPLOADME_API_URL=http://localhost:4000/api/v1
require('dotenv').config();

const client = new UploadMeClient({
  apiKey: process.env.UPLOADME_API_KEY,
  apiUrl: process.env.UPLOADME_API_URL,
});

Getting Your API Key

Local Development

  1. Start the UploadMe backend and dashboard
  2. Visit http://localhost:3000/dashboard/api-keys
  3. Click "Create API Key"
  4. Copy the generated key

Production

  1. Sign up at your deployed UploadMe instance
  2. Navigate to API Keys in the dashboard
  3. Generate a new API key
  4. Use it in your application

Requirements

  • Node.js >= 16.0.0
  • Valid UploadMe API key

License

MIT

Support

For issues and questions:

  • GitHub: https://github.com/MrCoderClark/UploadApp
  • Issues: https://github.com/MrCoderClark/UploadApp/issues