Universal Embed

Display embedded content, in a unified way

embed.js
const mql = require('@microlink/mql')

const embed = async (url, opts) => {
  const { data } = await mql(url, {
    meta: false,
    iframe: { maxWidth: 350 },
    ...opts
  })

  return data.iframe
}

const result = await embed('https://www.youtube.com/watch?v=9P6rdqiybaw')

mql.render(result)