TMDBrJS is a JavaScript library for interacting with the TMDB API.
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.
To use TMDBrJS, you need to have Node.js installed. Then, you can install the library using npm:
npm install tmdbrjs
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 });
Here are a few examples of how to use the TMDBrJS library:
const movieId = 12345;
const movie = await client.movies.getById(movieId);
console.log(movie);
const personId = 67890;
const results = await client.people.getById(personId);
console.log(results);
- Node.js >= 18
- pnpm (recommended) or npm
- TMDB API key
- Clone the repository:
git clone https://github.com/yourusername/TMDBrJS.git
cd TMDBrJS
- Install dependencies:
pnpm install
- Create a
.env.test
file in the root directory with your TMDB API key:
TMDB_API_KEY=your_api_key_here
The project uses Vitest for testing. There are two types of tests:
- Unit tests:
pnpm test
- 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
- Run linting:
pnpm lint
- Fix linting issues:
pnpm lint:fix
- Type checking:
pnpm check-types
The project uses GitHub Actions for continuous integration. The CI pipeline:
- Runs on Node.js 18.x, 20.x, and 21.x
- Performs the following checks:
- Linting
- Type checking
- Unit tests
- End-to-end tests
- Coverage reporting (via Codecov)
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.
- Create a new branch for your feature/fix
- Make your changes
- Run tests and linting
- Commit your changes using conventional commits
- Push your changes and create a pull request
TMDBrJS is licensed under the MIT License. See the LICENSE file for more information.