ytsearch.js
Runtime & Language

CommonJS

Use ytsearch.js from CommonJS applications with require().

js
const { searchYouTube } = require("ytsearch.js");

(async () => {
  const results = await searchYouTube("Black Panther", {
    type: "video",
    limit: 10,
  });

  results.videos.forEach((item) => {
    console.log(item.type, item.title);
  });
})();

The package's exports map points CommonJS require calls to dist/main.js.