Installation
Check your runtime, install just-yt with Bun, pnpm, or npm, and confirm that TypeScript can find the package.
Before writing code, make sure you have a JavaScript runtime and a project. A runtime is the program that executes your TypeScript or JavaScript.
What you need
just-yt needs the standard fetch, URL, and Response APIs. Node.js 18 or
newer, Bun, Deno, and modern edge runtimes provide them. The examples use
TypeScript, but the package also works from modern JavaScript.
If you are starting from an empty folder, create a package file first:
bun initpnpm initnpm init -yInstall the package
Choose the package manager your project already uses. You only need one of these commands.
bun add just-ytpnpm add just-ytnpm install just-ytThe package includes its own TypeScript declarations. Do not install a separate
@types/just-yt package.
Confirm the import
Create a small file and ask TypeScript to resolve the import:
import { YouTube } from 'just-yt';
const yt = new YouTube();
console.log(yt);
await yt.close();If your editor recognizes YouTube, installation is complete. If it does not,
check that the terminal command ran in the same folder as your package.json
and restart the editor’s TypeScript service.
You do not need an API key, environment variable, or Google Cloud account. Continue to your first request.