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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-torbox-api

v0.1.4

Published

Node.js client for Torbox API

Downloads

648

Readme

node-torbox-api

Unofficial Node.js client for the Torbox API. Provides a fully typed interface for interacting with Torbox's torrent, usenet, web download, and RSS services.

[WIP]

IMPORTANT This is a work in progress. It might be incomplete and some things haven't been tested yet, so it might be buggy.

Features

  • 🔒 Fully typed TypeScript API client
  • 📦 Complete API coverage (torrents, usenet, web downloads, RSS)
  • 🚀 Promise-based async methods
  • 💪 Built-in TypeScript type definitions
  • 🔄 Automatic request handling and error parsing

Installation

npm install node-torbox-api

Quick Start

import { TorboxClient } from 'node-torbox-api';

const client = new TorboxClient({
  apiKey: 'your-api-key',
  baseURL: 'https://api.torbox.app' // Optional, defaults to this URL
});

// Example: Get user profile
const profile = await client.users.getProfile();

// Example: Create a torrent download
const torrent = await client.torrents.createTorrent({
  magnet: 'magnet:?xt=urn:btih:...',
  name: 'My Download'
});

API Services

Torrents API

// Create a torrent download
await client.torrents.createTorrent({
  magnet: 'magnet:?xt=urn:btih:...',
  name: 'Optional Name'
});

// Get torrent list
const torrents = await client.torrents.getTorrentList();

// Control torrent
await client.torrents.controlTorrent(torrentId, 'pause');

Web Downloads API

// Create web download
await client.web.createWebDownload({
  url: 'https://example.com/file.zip',
  name: 'Optional Name'
});

// Get download list
const downloads = await client.web.getDownloadList();

Usenet API

// Create usenet download
await client.usenet.createUsenetDownload({
  url: 'nzb-url',
  name: 'Optional Name'
});

// Get usenet downloads
const usenetDownloads = await client.usenet.getDownloadList();

RSS API

// Add RSS feed
await client.rss.addRss({
  url: 'https://example.com/feed.xml',
  name: 'My Feed',
  regex: '.*720p.*'
});

User API

// Get user profile
const profile = await client.users.getProfile();

// Refresh token
await client.users.refreshToken();

Response Types

All API methods return a standardized response format:

interface StandardResponse<T = any> {
  success: boolean;
  data?: T;
  error?: string;
  message?: string;
}

Error Handling

try {
  await client.torrents.createTorrent({
    magnet: 'invalid-magnet'
  });
} catch (error) {
  console.error('API Error:', error.message);
}

Available Interfaces

The module exports all TypeScript interfaces for use in your application:

  • TorrentInfo
  • WebDownloadInfo
  • UsenetDownloadInfo
  • ServerStatus
  • Notification
  • And many more...

License

Apache-2.0

Support

For support, please visit Torbox Support or open an issue on GitHub.