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

rt-sdk

v0.1.3

Published

A simple little wrapper for Company X's APIs.

Downloads

31

Readme

rt-sdk

A simple little wrapper for Company X's APIs.

npm version

You can request things like:

  • series
  • episodes
  • livestreams
  • search results
  • products
  • and many more stuffz!

Get started!

  • Run yarn add rt-sdk in the root of your project. (This will add rt-sdk to your package.json)
// Import the rt-sdk
const rt = require('rt-sdk');
  • Use one of the available methods listed below to start building!
  • Remember that all rt-sdk methods return a Promise()
  • Also remember that the options object isn't required... its.. optional.

Define your options

The options object is a way of customizing your request to the rt-sdk. It isn't required, but setting options can be pretty helpful if you want to organize the results before the Promise resolves. You can use it to set maximum page item limits, organize items by oldest to newest, request a specific page of the results, etc. (If you aren't using any options, don't bother passing it to the method.)

const options = {
    order: 'desc',
    per_page: '10',
    page: 1
}

Get all series

rt.series() only takes the optional options obj.

rt.series(options)
    .then(series => {        
        for (let serie of series) {
            console.log(serie.attributes.title); 
            console.log(serie.type); 
            console.log(serie.attributes.slug);
            console.log(serie.attributes.summary);
        }
    });

Get all seasons of a specific series

rt.seasons() takes a series slug (and options).

rt.seasons('rt-podcast', options)
    .then(seasons => {
        for (let season of seasons) {
            console.log(season.attributes.title);
        }
    });

Get all episodes of a specific season

rt.season() takes a season slug (and options).

rt.season('always-open-2018', options)
    .then(episodes => {
        for (let episode of episodes) {
            console.log(episode.attributes.title);
            console.log(episode.attributes.description);
            console.log(episode.attributes.number);
        }
    });

Get a specific episode

rt.episode() takes an episode slug (and options).

rt.episode('lets-play-2012-16', options)
    .then(episode => {
        console.log(episode.attributes.show_title);
        console.log(episode.attributes.title); 
        console.log(episode.attributes.description);
        console.log(episode.included.images);
    });

Get all products of a specific series

rt.products() takes a series slug (and options). If there isn't a specific product collection associated with the series it will return generic products.

rt.products('cow-chop-gaming', options)
    .then(products => {
        for (let product of products) {
            console.log(product.title);
            console.log(JSON.stringify(product.body_html));
            console.log(product.image.src);
            console.log(product.url);
        }
    });

Get all upcoming (or in progress) livestreams

rt.livestream() only takes the optional options obj.

rt.livestreams(options)
    .then(episodes => {
        for (let episode of episodes) {
            console.log(episode.attributes.title); 
            console.log(episode.type); 
            console.log(episode.attributes.description);
            console.log(episode.included.images);
        }
    });

Search Episodes

rt.searchEpisodes() takes an episode query string (and options).

rt.searchEpisodes('Mark Nutt', options)
    .then(episodes => {
        for (let episode of episodes) {
            console.log(episode.attributes.title); 
            console.log(episode.type); 
            console.log(episode.attributes.slug);
        }
    });

In progress.. More coming soon!

  • Tests to make sure I don't deploy and break yer shit
  • TypeScript Typings
  • Options Obj (order, per_page, page)
  • Featured Products
  • Scope options
  • Schedule
  • All Channels
  • All Series in a Channel
  • All Episodes in a Channel
  • Featured Items in a Channel
  • Featured Products in a Channel
  • Show Episodes by Bulk
  • Related Series
  • Season Images
  • Episode Images
  • Episode Videos
  • Query by Series
  • List of all Genres
  • Bonus Features?
  • Marketing Banners..? ¯_(ツ)_/¯