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

@pixam/streamtape

v1.0.1

Published

A production-grade TypeScript wrapper for the StreamTape API

Downloads

6

Readme

StreamTape API Wrapper

A production-grade TypeScript wrapper for the StreamTape API, providing a clean and type-safe interface for interacting with StreamTape's video hosting service.

Features

  • 🚀 Full TypeScript support with comprehensive type definitions
  • 🔄 Automatic retry mechanism for failed requests
  • 🛡️ Built-in error handling and custom error types
  • 📝 Complete API coverage with well-documented methods
  • 🎯 Progress tracking for uploads and downloads
  • ⚡ Promise-based async/await interface
  • 🔍 Detailed debugging information
  • 🧪 Built with testability in mind

Installation

# Using npm
npm install @pixam/streamtape

# Using Yarn
yarn add @pixam/streamtape

# Using Bun
bun add @pixam/streamtape

Quick Start

import { StreamTape } from '@pixam/streamtape';

// Initialize the client
const client = new StreamTape({
  login: 'your-api-login',
  key: 'your-api-key'
});

// Example: Get account information
const accountInfo = await client.account.getAccountInfo();
console.log(accountInfo);

Usage Examples

Account Operations

// Get account information
const accountInfo = await client.account.getAccountInfo();

File Operations

// List files in a folder
const files = await client.file.listFolder('folder-id');

// Get file information
const fileInfo = await client.file.getFileInfo('file-id');

// Create a new folder
const folderId = await client.file.createFolder('My Folder');

// Delete a file
await client.file.deleteFile('file-id');

Download Operations

// Get a download link in one step
const downloadLink = await client.download.getDirectDownloadLink('file-id');

// Or get a ticket first and then the download link
const ticket = await client.download.getDownloadTicket('file-id');
const link = await client.download.getDownloadLink('file-id', ticket.ticket);

Upload Operations

// Upload a local file with progress tracking
const fileId = await client.upload.uploadFile('/path/to/file.mp4', {
  onProgress: (progress) => {
    console.log(`Upload progress: ${progress * 100}%`);
  }
});

// Add a remote upload
const remoteUpload = await client.upload.addRemoteUpload('https://example.com/video.mp4', {
  name: 'My Video'
});

// Wait for remote upload to complete with progress tracking
const status = await client.upload.waitForRemoteUpload(remoteUpload.id, {
  onProgress: (status) => {
    console.log(`Remote upload status: ${status.status}`);
  }
});

Advanced Configuration

const client = new StreamTape({
  login: 'your-api-login',
  key: 'your-api-key',
  baseUrl: 'https://api.streamtape.com', // Optional custom base URL
  timeout: 30000, // Request timeout in milliseconds
  retry: {
    maxRetries: 3,
    baseDelay: 1000,
    maxDelay: 5000,
    retryableStatusCodes: [429, 503]
  }
});

Error Handling

The wrapper provides custom error types for better error handling:

import {
  StreamTapeError,
  AuthenticationError,
  ValidationError,
  RateLimitError,
  NotFoundError,
  ApiRequestError,
  NetworkError
} from '@pixam/streamtape';

try {
  await client.file.getFileInfo('invalid-id');
} catch (error) {
  if (error instanceof NotFoundError) {
    console.log('File not found');
  } else if (error instanceof AuthenticationError) {
    console.log('Authentication failed');
  } else if (error instanceof RateLimitError) {
    console.log('Rate limit exceeded');
  }
}

TypeScript Support

The wrapper is written in TypeScript and provides comprehensive type definitions for all API responses and parameters:

import { AccountInfo, FileInfo, DownloadLink } from '@pixam/streamtape';

async function downloadFile(fileId: string): Promise<DownloadLink> {
  const fileInfo: FileInfo = await client.file.getFileInfo(fileId);
  return client.download.getDirectDownloadLink(fileId);
}

Contributing

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

License

This project is licensed under the MIT License - see the LICENSE file for details.