# @elara-services/youtube-videos

> Listen for YouTube videos for creators

Latest version **1.1.2** (published 2025-03-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install @elara-services/youtube-videos
pnpm add @elara-services/youtube-videos
yarn add @elara-services/youtube-videos
bun add @elara-services/youtube-videos
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2025-03-21 |
| First published | 2022-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 12.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | SUPERCHIEFYT |
| Maintainers | elara-services |
| Keywords | youtube, youtube-videos, videos |

## Links

- npm: https://www.npmjs.com/package/@elara-services/youtube-videos
- Repository: https://github.com/elara-bots/npm.git#youtube-videos
- Homepage: https://github.com/elara-bots/npm/tree/youtube-videos#readme
- Issues: https://github.com/elara-bots/npm/issues
- npm.io page: https://npm.io/package/@elara-services/youtube-videos

## Dependencies (5)

- [moment](https://npm.io/package/moment.md) 2.29.4
- [rss-parser](https://npm.io/package/rss-parser.md) 3.12.0
- [@elara-services/fetch](https://npm.io/package/@elara-services/fetch.md) ^2.0.3
- [moment-duration-format](https://npm.io/package/moment-duration-format.md) 2.3.2
- [@elara-services/basic-utils](https://npm.io/package/@elara-services/basic-utils.md) ^1.0.9

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2025-03-21
- 1.1.1 — 2023-01-12
- 1.1.0 — 2022-11-17
- 1.0.9 — 2022-11-17
- 1.0.8 — 2022-11-11
- 1.0.7 — 2022-11-08
- 1.0.6 — 2022-11-07
- 1.0.5 — 2022-11-07
- 1.0.4 — 2022-11-06
- 1.0.3 — 2022-11-06
- 1.0.2 — 2022-11-04
- 1.0.1 — 2022-11-02
- 1.0.0 — 2022-11-02

## README

# Getting Started

```js
const { YouTubeVideos } = require("@elara-services/youtube-videos"),
        youtube = new YouTubeVideos();
```

## Add Creators
```js
// Adding a single creator     
youtube.creators.add("UCzEnk4KWFlSj_PjXLz0"); // Adds the channelID to the 'data' set


// Bulk adding creators
youtube.creators.bulk([
    "UCzEnk4KWFlSj_PjXLz0",
    "UC....",
    "UC.....", 
]);
// Adds all of the channelIDs to the 'data' set.
```

## Remove Creator
```js
youtube.creators.remove("UCzEnk4KWFlSj_PjXLz0"); // Remove the channelID from the 'data' set
```

## List Creators
```js
youtube.creators.list(); // Returns an array of channelIDs
```

## Set Interval/Search Minutes
```js
youtube.setSearch(1); // The interval will be 1 minute
// DEFAULT: 2 minutes
```

## Listen to video announcements
```js
youtube.listen("video", async (channelID, videos) => {
    // Code to do whatever when a new video is found. 
    // channelID: the creator's channelID
    // videos: The array of videos found for the user.
});
```

## Listen to searching creators for videos
```js
youtube.listen("searching", async (channels) => {
    // Code to do whatever when this event gets triggered. 
    // Channels: the array of creator channelIDs
});
```


## Start the process
```js
youtube.run();
```


## Get More Information for videos

```js
const { util: { fetchVideos } } = require("@elara-services/youtube-videos");

// `[ ... ]` provide the video IDs in an array!
const videos = await fetchVideos([ ... ], "YOUTUBE_API_KEY");
// Array of videos found

```

---
_Source: https://npm.io/package/@elara-services/youtube-videos · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
