1. get-youtube-id
Parse a youtube url returning the video ID.
get-youtube-id
Package: get-youtube-id
Created by: jmorrell
Last modified: Sat, 18 Jun 2022 07:57:05 GMT
Version: 1.0.1
License: MIT
Downloads: 263,859
Repository: https://github.com/jmorrell/get-youtube-id

Install

npm install get-youtube-id
yarn add get-youtube-id

get-youtube-id

Parse a youtube url returning the video ID.

Installation

npm install get-youtube-id

Example

 var getYouTubeID = require('get-youtube-id');

var id = getYouTubeID("http://www.youtube.com/watch?v=9bZkp7q19f0");
console.log(id); // "9bZkp7q19f0"


// Or, if you're using ES6 syntax:
import getYouTubeID from 'get-youtube-id';

Fuzzy matching

By default getYouTubeID will make a last-ditch effort to look for anything that resembles
an 11-character id. If you want it to be more strict you can turn this off with an options
argument.

 var getYouTubeID = require('get-youtube-id');

var id = getYouTubeID("youtube abcdefghijk", {fuzzy: false});
console.log(id); // null

License

MIT

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin