
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
link-to-iframe
Advanced tools
A TypeScript package that transforms URLs from various services (YouTube, Loom, etc.) into embeddable iframe HTML.
😘 Maintainer: @baptistejamin
| Crisp |
👋 You use this library and you want to be listed there? Contact us.
This library transforms URLs from various services into embeddable iframe HTML code:
npm install link-to-iframe
import { linkToFrame } from "link-to-iframe";
// YouTube example
const youtubeHtml = linkToFrame("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
console.log(youtubeHtml);
// <iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
// Loom example
const loomHtml = linkToFrame("https://www.loom.com/share/abcdef123456");
console.log(loomHtml);
// <iframe width="560" height="315" src="https://www.loom.com/embed/abcdef123456" frameborder="0" allowfullscreen></iframe>
// Custom attributes for all iframes
const customHtml = linkToFrame("https://www.youtube.com/watch?v=dQw4w9WgXcQ", {
defaultAttributes: {
width: 640,
height: 360,
style: "border: none;"
}
});
console.log(customHtml);
// <iframe width="640" height="360" src="https://www.youtube.com/embed/dQw4w9WgXcQ" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="border: none;"></iframe>
// Adding custom URL transformers
import { Transformer } from "link-to-iframe";
const vimeoTransformer: Transformer = {
pattern: /(?:https?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/i,
transform: (url, matches) => {
const videoId = matches[1];
return {
src: `https://player.vimeo.com/video/${videoId}`,
allowfullscreen: true,
frameborder: 0,
width: 560,
height: 315
};
}
};
const vimeoHtml = linkToFrame("https://vimeo.com/123456789", {
additionalTransformers: [vimeoTransformer]
});
console.log(vimeoHtml);
// <iframe width="560" height="315" src="https://player.vimeo.com/video/123456789" allowfullscreen frameborder="0"></iframe>
Currently, the following services are supported out of the box:
The library is designed to be easy to extend and non-opinionated. Contributions for new service integrations are welcome and will be merged easily as long as they are simple enough. Contributions made with AI assistance (like GPT) are also accepted. See the custom transformer example in the Usage section for a starting point.
You can customize the output in two ways:
By default, all iframes are rendered with a width of 560 and height of 315 pixels (standard YouTube dimensions). You can customize these values using the defaultAttributes option.
link-to-iframe is released under the MIT License. See the bundled LICENSE file for details.
FAQs
Transform links to embeddable iframes
The npm package link-to-iframe receives a total of 66 weekly downloads. As such, link-to-iframe popularity was classified as not popular.
We found that link-to-iframe demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.