Skip to content

Commit af87527

Browse files
committed
feat: add movie service
0 parents  commit af87527

23 files changed

Lines changed: 4972 additions & 0 deletions

.eslintrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
env: { node: true, es2021: true },
5+
parser: "@typescript-eslint/parser",
6+
parserOptions: { sourceType: "module" },
7+
plugins: ["@typescript-eslint"],
8+
extends: [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"prettier"
12+
],
13+
ignorePatterns: ["dist/**"]
14+
};

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# dependencies (bun install)
2+
node_modules
3+
4+
# output
5+
out
6+
dist
7+
*.tgz
8+
9+
# code coverage
10+
coverage
11+
*.lcov
12+
13+
# logs
14+
logs
15+
_.log
16+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17+
18+
# dotenv environment variable files
19+
.env
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
.env.local
24+
25+
# caches
26+
.eslintcache
27+
.cache
28+
*.tsbuildinfo
29+
30+
# IntelliJ based IDEs
31+
.idea
32+
33+
# Finder (MacOS) folder config
34+
.DS_Store
35+
36+
# Build output
37+
/dist

.npmignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
src/
2+
tests/
3+
coverage/
4+
.github/
5+
.vscode/
6+
.eslintrc.js
7+
.prettierrc
8+
tsconfig.json
9+
tsconfig.build.json
10+
vitest.config.ts
11+
*.log
12+
.env

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
access=public

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": false,
4+
"semi": true,
5+
"trailingComma": "es5"
6+
}

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# tmdb
2+
3+
> Unofficial TypeScript SDK for The Movie Database (TMDb) API v3.
4+
> Works in Node 18+ and modern browsers.
5+
> This product uses the TMDb API but is not endorsed or certified by TMDb.
6+
7+
## Install
8+
9+
```sh
10+
npm install @vo1x/tmdb
11+
# or
12+
pnpm add @vo1x/tmdb
13+
```
14+
15+
## Quick Start
16+
17+
```ts
18+
import { TMDB } from "@vo1x/tmdb";
19+
20+
const tmdb = new TMDB({
21+
apiKey: process.env.TMDB_API_KEY!, // required
22+
language: "en-US" // optional default
23+
});
24+
25+
async function main() {
26+
// Get movie details
27+
const movie = await tmdb.movie.getById(27205);
28+
console.log(movie.title); // "Inception"
29+
30+
// Get movie credits
31+
const credits = await tmdb.movie.credits(27205);
32+
console.log(credits.cast.map(c => c.name));
33+
34+
// Get recommendations
35+
const recs = await tmdb.movie.recommendations(27205, { page: 1 });
36+
for (const r of recs.results) {
37+
console.log(r.title);
38+
}
39+
}
40+
41+
main();
42+
```
43+
44+
## API
45+
46+
Currently supports:
47+
- Movies — details, credits, images, recommendations, similar
48+
49+
## Requirements
50+
- Node.js 18+ or modern browsers (global fetch available)
51+
- TMDb v3 API key (get one at https://www.themoviedb.org/settings/api)
52+
53+
## License
54+
MIT © vo1x

0 commit comments

Comments
 (0)