Socket
Book a DemoInstallSign in
Socket

@bret/is-youtube-url

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bret/is-youtube-url

WIP - nothing to see here

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

@bret/is-youtube-url

latest version Actions Status Coverage Status downloads Types in JS neostandard javascript style Socket Badge

Check if a given URL belongs to YouTube or Google Video domains.

Installation

npm install @bret/is-youtube-url

Usage

import isYouTubeUrl from '@bret/is-youtube-url';

const url = new URL('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
console.log(isYouTubeUrl(url)); // true

const invalidUrl = new URL('https://www.example.com');
console.log(isYouTubeUrl(invalidUrl)); // false

API

isYouTubeUrl(parsedUrl)

Parameters:

  • parsedUrl (URL): A valid URL object that has already been validated.

Returns:

  • boolean: true if the URL belongs to YouTube or Google Video domains, otherwise false.

Supported Domains:

  • www.youtube.com
  • youtube.com
  • m.youtube.com
  • youtu.be
  • youtube-nocookie.com
  • googlevideo.com

License

MIT

FAQs

Package last updated on 27 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts