Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

elm-oembed

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

elm-oembed

A Custom Element and accompanying Elm package for displaying oembed content.

latest
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

elm-oembed

Elm package npm

A Web Component and accompanying Elm package for rendering oembed content.

Width and height are sized dynamically based on the loaded content. Script tags are safely loaded within an iframe.

What is oembed

oembed is a protocol, with many providers implementing it. It allows you to turn a URL into embeddable content.

These examples will render a YouTube player, an embedded Tweet, a Giphy .gif of the desired dimensions, and an Elm code snippet in Ellie. Check out the examples folder to see it in action!

div []
    [ Oembed.viewOrDiscover Nothing "https://www.youtube.com/watch?v=43eM4kNbb6c"
    , Oembed.viewOrDiscover Nothing "https://twitter.com/dillontkearns/status/1105250778233491456"
    , Oembed.viewOrDiscover (Just { maxWidth = 250, maxHeight = 1000 }) "https://giphy.com/gifs/art-weird-ewan-26hiu3mZVquuykwhy"
    , Oembed.viewOrDiscover Nothing "https://ellie-app.com/4Xt4jdgtnZ2a1"
    ]

Setup

Just load the Web Component like so:

npm install --save-dev elm-oembed
import "elm-oembed";

FAQs

Package last updated on 24 Sep 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