
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
html2oembed
Advanced tools
Create oEmbed JSON from HTML
Install with npm:
$ npm install --save-dev html2oembed
Via code:
const html2oembed = require('html2oembed');
const html = '<html><head><title>My awesome app</title><link href="/css/app.61f9f8cc.css" rel="stylesheet"></head><body><div id="app"></div><script type="text/javascript" src="/js/chunk-vendors.e42a3317.js"></script><script type="text/javascript" src="/js/app.c0e16a2e.js"></script></body></html>';
const parsed = html2oembed.parse(html);
const json = JSON.stringify(parsed);
Via CLI:
# Display help
$ npx html2oembed --help
# Convert HTML to oEmbed JSON
$ npx html2oembed convert ./index.html ./oembed.json
{
"version": "1.0",
"type": "rich",
"title": "My awesome app",
"html": "<link href=\"/css/app.61f9f8cc.css\" rel=\"stylesheet\"><div id=\"app\"></div><script type=\"text/javascript\" src=\"/js/chunk-vendors.e42a3317.js\"></script><script type=\"text/javascript\" src=\"/js/app.c0e16a2e.js\"></script>",
"width": "100%",
"height": "100%"
}
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.
FAQs
Create oEmbed JSON from HTML
We found that html2oembed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.