npm-get-youtube-id

This module will extract Youtube video id from URL string

Usage no npm install needed!

<script type="module">
  import npmGetYoutubeId from 'https://cdn.skypack.dev/npm-get-youtube-id';
</script>

README

CLI

For use CLI need install npm-get-youtube-id using -g param.

Example (return id or null)

var getYoutubeId = require('npm-get-youtube-id');

var id = getYoutubeId('https://www.youtube.com/watch?v=w9bZSeT8iK4');