tmdbrjs
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

TMDBrJS

TMDBrJS is a JavaScript library for interacting with the TMDB API.

Disclaimer

Important Notice:

This package is a personal project and may not be actively maintained or thoroughly documented. Use it at your own risk. Contributions are welcome, but please note that there might be limited support and updates.

Installation

To use TMDBrJS, you need to have Node.js installed. Then, you can install the library using npm:

npm install tmdbrjs

Usage

To instantiate the client, you need to provide your TMDB API key. You can obtain an API key by creating an account on the TMDB website.

import { Client } from 'tmdbrjs';

const apiKey = 'YOUR_API_KEY';
const client = new Client({ apiKey });

Examples

Here are a few examples of how to use the TMDBrJS library:

Get movie details

const movieId = 12345;
const movie = await client.movies.getById(movieId);
console.log(movie);

Get person details

const personId = 67890;
const results = await client.people.getById(personId);
console.log(results);

Development

Prerequisites

  • Node.js >= 18
  • pnpm (recommended) or npm
  • TMDB API key

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/TMDBrJS.git
cd TMDBrJS
  1. Install dependencies:
pnpm install
  1. Create a .env.test file in the root directory with your TMDB API key:
TMDB_API_KEY=your_api_key_here

Running Tests

The project uses Vitest for testing. There are two types of tests:

  1. Unit tests:
pnpm test
  1. End-to-end tests:
pnpm test:e2e

For e2e tests, you can provide the API key in two ways:

  • Set it in the .env.test file
  • Set it as an environment variable: TMDB_API_KEY=your_api_key_here pnpm test:e2e

Code Quality

  • Run linting: pnpm lint
  • Fix linting issues: pnpm lint:fix
  • Type checking: pnpm check-types

CI/CD

The project uses GitHub Actions for continuous integration. The CI pipeline:

  1. Runs on Node.js 18.x, 20.x, and 21.x
  2. Performs the following checks:
    • Linting
    • Type checking
    • Unit tests
    • End-to-end tests
    • Coverage reporting (via Codecov)

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

Development Workflow

  1. Create a new branch for your feature/fix
  2. Make your changes
  3. Run tests and linting
  4. Commit your changes using conventional commits
  5. Push your changes and create a pull request

License

TMDBrJS is licensed under the MIT License. See the LICENSE file for more information.

Package Sidebar

Install

npm i tmdbrjs

Weekly Downloads

40

Version

1.5.0

License

MIT

Unpacked Size

135 kB

Total Files

59

Last publish

Collaborators

  • foestauf