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

rarbg-api-ts

v1.0.22

Published

rarbg api wraper written in typescript

Downloads

13

Readme

Installation

download the module

npm i rarbg-api-ts

include it in your project

// node way
const { rarbg } = require('rarbg-api-ts')

// es6 way
import { rarbg } from 'rargn-api-ts'

want to extend the api with your own functions? no problem, just import the "Rargb" class.

// node way
const { rarbg, Rargb } = require('tvmaze-api-ts')
 
// es6 way
import { rarbg, Rargb } from 'tvmaze-api-ts'
 
class Myrarbg extends Rargb {
  // code
}
 
const myrarbg = new Myrarbg()

made with ♥️ and typescript

I added complete type support for all json api returns.

List

Get a list of torrents.

// (...params: Iparam[]): Promise
rarbg.list().then(result => {
  // code
})

Search

Search for a torrent.

// (searchString: string, ...params: Iparam[]): Promise
rarbg.search('silicon valley').then(result => {
  // code
})

Search Imdb

Search for a torrent using a Imdb Id

// (imdbId: string, ...params: Iparam[]): Promise
rarbg.searchImdb('tt2575988').then(result => {
  // code
})

Search Tvdb

Search for a torrent using a Tvdb Id.

// (imdbId: string, ...params: Iparam[]): Promise
rarbg.searchTvdb('277165').then(result => {
  // code
})

Parameters

Extend your search querys.

possible parameters are:

  • category

    will restrict results to a certain category

    Default is ALL

  • format

    this defines what kind of results you get back

    Default is SHORT

  • limit

    this will limit or extend the ammount of results

    Default is MEDIUM

  • min_leechers

    this will restrict results to torrents that have a certain ammount of leechers

    Default is "0"

  • min_seeders

    this will restrict results to torrents that have a certain ammount of seeders

    Default is "0"

  • ranked

    this will decide if you only want to display scene torrents or not

    Default is ONLY

  • sort

    sort parameter will sort the results by seeders,leechers,last.

    Default is LAST

Parameter Enums

For simplicity I created enums for every parameter value.

rarbg.enums

Default Parameters

You can set default parameters that apply to every request.

  rarbg.default.category = rarbg.enums.CATEGORY.TV

Request Parameters

You can also set parameters for each Api request you do, by simply adding a json object with your wanted parameters to any Api function call like so (this will overwrite parameters set with rarbg.default):

rarbg.list({ category: rarbg.enums.CATEGORY.TV })
  .then(result => {
    // code
  })

rarbg.search('silicon valley', { category: rarbg.enums.CATEGORY.TV })
  .then(result => {
    // code
  })

rarbg.list({ format: rarbg.enums.FORMAT.EXTENDED })
  .then((torrents: ItorrentExtended[]) => {
    // code
  })

Limits

The rargb api is limited to 1 request per 2 seconds per ip. Dont worry tho, rarbg-api-ts will automaticly keep you within this limit.

It will also automaticly request api tokens for you and replace them once they expire.