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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ng-tmdb

v0.0.4

Published

Angular library for querying The Movie Database (TMDB) API with typed models and view-models.

Readme

ng-tmdb

An Angular library that provides easy access to The Movie Database (TMDB) API, offering services and view-models for movies, TV shows, and people.

Features

  • MovieService: Fetch movie details, now playing, popular, and more.
  • TvShowService: Access TV show information, trending, and recommendations.
  • PersonService: Retrieve actor, director, and crew info from TMDB.
  • View-models: Use provided view-models for easy state management and UI binding.

Prerequisites

Getting Started

1. Install the package

npm install ng-tmdb

2. Configure TMDB API Key

In your app.config.ts, add provideTmdb({ apiKey: '<your api key here>' }) to your ApplicationConfig providers:

import { provideTmdb } from 'ng-tmdb';

export const appConfig: ApplicationConfig = {
  providers: [
    provideBrowserGlobalErrorListeners(),
    provideTmdb({ apiKey: '<your api key here>' }),
    // ...other providers
  ],
};

3. Provide Services and View-Models

Add the desired TMDB services and view-models to your component's providers:

import { Component } from '@angular/core';
import { MovieService, MovieViewModel } from 'ng-tmdb';

@Component({
  selector: 'app-home',
  providers: [MovieService, MovieViewModel],
  templateUrl: './home.html',
  styleUrl: './home.scss',
})
export class HomeComponent {}

Usage Examples

MovieService Example

import { Component } from '@angular/core';
import { MovieService } from 'ng-tmdb';

@Component({
  selector: 'app-movies',
  providers: [MovieService],
  template: `<ul>
    @for (movie of movies; track movie.id) {
      <li>{{ movie.title }}</li>
    }
  </ul>`,
})
export class MoviesComponent {
  movies = [];
  constructor(private _movieService: MovieService) {
    this._movieService.getNowPlayingMovies().subscribe({
      next: (result) => (this.movies = result.results),
      error: (err) => console.error(err),
    });
  }
}

TvShowService Example

import { Component } from '@angular/core';
import { TvShowService } from 'ng-tmdb';

@Component({
  selector: 'app-tvshows',
  providers: [TvShowService],
  template: `<ul>
    @for (show of shows; track show.id) {
      <li>{{ show.name }}</li>
    }
  </ul>`,
})
export class TvShowsComponent {
  shows = [];
  constructor(private _tvShowService: TvShowService) {
    this._tvShowService.getPopularTvShows().subscribe({
      next: (result) => (this.shows = result.results),
      error: (err) => console.error(err),
    });
  }
}

PersonService Example

import { Component } from '@angular/core';
import { PersonService } from 'ng-tmdb';

@Component({
  selector: 'app-people',
  providers: [PersonService],
  template: `<ul>
    @for (person of people; track person.id) {
      <li>{{ person.name }}</li>
    }
  </ul>`,
})
export class PeopleComponent {
  people = [];
  constructor(private _personService: PersonService) {
    this._personService.getPopularPeople().subscribe({
      next: (result) => (this.people = result.results),
      error: (err) => console.error(err),
    });
  }
}

TMDB API Key Setup

  1. Sign up for a TMDB account if you don't have one.
  2. Create a new API key in your TMDB account settings.
  3. Use the API key in your Angular app configuration:
provideTmdb({ apiKey: '<your api key here>' });

Contributing

Contributions are welcome! Please open an issue or submit a pull request to help improve ng-tmdb.

License

MIT License. See LICENSE for details.