{"id":14006868,"url":"https://github.com/remarkablemark/youtube-video-id","last_synced_at":"2025-03-19T20:31:18.200Z","repository":{"id":57404341,"uuid":"69816897","full_name":"remarkablemark/youtube-video-id","owner":"remarkablemark","description":"📺 Extract the YouTube video ID from a string or URL.","archived":false,"fork":false,"pushed_at":"2025-03-11T16:12:54.000Z","size":2121,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T10:51:44.002Z","etag":null,"topics":["javascript","npm","youtube","youtube-video-id"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/youtube-video-id","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remarkablemark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["remarkablemark"],"patreon":"remarkablemark","open_collective":null,"ko_fi":"remarkablemark","tidelift":null,"community_bridge":null,"liberapay":"remarkablemark","issuehunt":null,"otechie":null,"custom":["https://b.remarkabl.org/teespring"]}},"created_at":"2016-10-02T19:21:03.000Z","updated_at":"2025-03-11T16:12:56.000Z","dependencies_parsed_at":"2022-09-08T14:12:47.195Z","dependency_job_id":"380d21b8-d2a4-4796-a511-8dc954cd1ddc","html_url":"https://github.com/remarkablemark/youtube-video-id","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fyoutube-video-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fyoutube-video-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fyoutube-video-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fyoutube-video-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkablemark","download_url":"https://codeload.github.com/remarkablemark/youtube-video-id/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244501307,"owners_count":20462839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","npm","youtube","youtube-video-id"],"created_at":"2024-08-10T10:01:40.904Z","updated_at":"2025-03-19T20:31:17.434Z","avatar_url":"https://github.com/remarkablemark.png","language":"JavaScript","funding_links":["https://github.com/sponsors/remarkablemark","https://patreon.com/remarkablemark","https://ko-fi.com/remarkablemark","https://liberapay.com/remarkablemark","https://b.remarkabl.org/teespring"],"categories":["JavaScript"],"sub_categories":[],"readme":"# youtube-video-id\n\n[![NPM](https://nodei.co/npm/youtube-video-id.png)](https://nodei.co/npm/youtube-video-id/)\n\n[![NPM version](https://img.shields.io/npm/v/youtube-video-id.svg)](https://www.npmjs.com/package/youtube-video-id)\n[![build](https://github.com/remarkablemark/youtube-video-id/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/youtube-video-id/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/remarkablemark/youtube-video-id/graph/badge.svg?token=PQL6PG63WG)](https://codecov.io/gh/remarkablemark/youtube-video-id)\n\n:tv: Extract the YouTube video ID from a string or URL:\n\n```\nYouTubeVideoId(string)\n```\n\n[Replit](https://replit.com/@remarkablemark/youtube-video-id) | [JSFiddle](https://jsfiddle.net/remarkablemark/93fkfb22/) | [Examples](https://github.com/remarkablemark/youtube-video-id/tree/master/examples)\n\n## Installation\n\n[NPM](https://www.npmjs.com/package/youtube-video-id):\n\n```sh\nnpm install youtube-video-id\n```\n\n[Yarn](https://yarnpkg.com/package?name=youtube-video-id):\n\n```sh\nyarn add youtube-video-id\n```\n\n[CDN](https://unpkg.com/browse/youtube-video-id/):\n\n```html\n\u003cscript src=\"https://unpkg.com/youtube-video-id@latest/dist/youtube-video-id.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Server\n\nImport with ES Modules:\n\n```js\nimport YouTubeVideoId from 'youtube-video-id';\n```\n\nOr require with CommonJS:\n\n```js\nconst YouTubeVideoId = require('youtube-video-id').default;\n```\n\nExtract YouTube video ID from URL or string:\n\n```js\nYouTubeVideoId('https://www.youtube.com/watch?v=X3pTXG9a1oQ'); // 'X3pTXG9a1oQ'\nYouTubeVideoId('https://youtu.be/X3pTXG9a1oQ'); // 'X3pTXG9a1oQ'\nYouTubeVideoId('X3pTXG9a1oQ'); // 'X3pTXG9a1oQ'\n```\n\n### Client\n\nLoad script:\n\n```html\n\u003cscript src=\"https://unpkg.com/youtube-video-id@latest/dist/youtube-video-id.min.js\"\u003e\u003c/script\u003e\n```\n\nExtract YouTube video ID from URL or string:\n\n```html\n\u003cscript\u003e\n  const videoId = YouTubeVideoId('https://www.youtube.com/watch?v=F2uovvU-dLA');\n  console.log(videoId);\n\u003c/script\u003e\n```\n\n## Migration\n\n### v1\n\nMigrate to TypeScript and build ESM. CommonJS import now requires the `.default` key:\n\n```js\nconst YouTubeVideoId = require('youtube-video-id').default;\n```\n\n## Release\n\nRelease is automated with [Release Please](https://github.com/googleapis/release-please).\n\n## License\n\n[MIT](https://github.com/remarkablemark/youtube-video-id/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Fyoutube-video-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkablemark%2Fyoutube-video-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Fyoutube-video-id/lists"}