@harshppatel/nestjs-themoviedb-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

NestJS Node TheMovieDb

Introduction

This is a simple NestJS wrapper of node-themoviedb. This repo supports all the endpoints from the library. If I missed anything, Contribute! Looking forward to your PR/issue!

Installation

npm i @harshppatel/nestjs-themoviedb-api node-themoviedb

Usage

Importing Module:

import { TheMovieDbModule } from '@harshppatel/nestjs-themoviedb-api';

@Module({
  imports: [
    TheMovieDbModule.forRoot({
      API_KEY: '<Your API_KEY>', // You can also pass `language` option from node-themoviedb library
    }),
  ],
  providers: [],
  exports: [],
})
export class YourModule {}

Importing Module Async:

import { TheMovieDbModule } from '@harshppatel/nestjs-themoviedb-api';

@Module({
  imports: [
    TheMovieDbModule.forAsyncRoot({
      useFactory: async () => {
        return {
          API_KEY: '<Your API_KEY>', // You can also pass `language` option from node-themoviedb library
        };
      },
    }),
  ],
  providers: [],
  exports: [],
})
export class YourModule {}

Endpoint Example

Here is an example on how to use an endpoint from node-themoviedb library. You can learn more about these endpoints here.

import { TheMovieDbService } from '@harshppatel/nestjs-themoviedb-api';

@Injectable()
export class YourService {
  constructor(private readonly theMovieDbService: TheMovieDbService) {}

  async getHello() {
    const args = {
      pathParameters: {
        movie_id: 384018,
      },
    };
    return await this.theMoviedbService.getMovieEndpoint().getDetails(args);
  }
}

Change Log

See Changelog for more information.

Contributing

Contributions welcome! See Contributing.

Author

Harsh Patel (YouTube Channel)

License

Licensed under the MIT License - see the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i @harshppatel/nestjs-themoviedb-api

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

22.7 kB

Total Files

19

Last publish

Collaborators

  • harshppatel