get-youtube-id
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    64,970
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    64,970
  • 1.0.0
    310
  • 0.1.3
    970
  • 0.1.2
    2
  • 0.1.1
    2
  • 0.1.0
    2

Package Sidebar

Install

npm i get-youtube-id

Weekly Downloads

66,256

Version

1.0.1

License

MIT

Unpacked Size

7.09 kB

Total Files

7

Last publish

Collaborators

  • jmorrell