Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-youtube-id

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-youtube-id

Parse a youtube url returning the video ID.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
59K
increased by3.11%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 24 Jan 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc