@social-embed/lib
v0.1.0-next.7
Published
URL detection and parsing for embed providers (YouTube, other OEmbed compatible providers),
Downloads
1,396
Maintainers
Readme
@social-embed/lib
·
Start
To use the lib you can do:
npm i @social-embed/lib
# or
yarn add @social-embed/lib
Then import and use as such:
import { getYouTubeIdFromUrl } from "@social-embed/lib";
console.log(getYouTubeIdFromUrl("https://www.youtube.com/watch?v=Bd8_vO5zrjo"));
// output: Bd8_vO5zrjo
If you support ESM / Urls, you can also import via like this:
// unpkg
import {getYouTubeIdFromUrl} from 'https://www.unpkg.com/@social-embed/lib?module';
// skypack
import {getYouTubeIdFromUrl} from 'https://cdn.skypack.dev/@social-embed/lib';
API reference
https://social-embed.git-pull.com/api/