npm.io
0.0.4 • Published 7 years ago

resolve-oembed

Licence
MIT
Version
0.0.4
Deps
2
Size
84 kB
Vulns
1
Weekly
0

resolve-oembed

Usage

async module for resolving oembed data for URLs

const oembed = require('resolve-oembed')

async function run() {
  await oembed('https://www.instagram.com/p/BwwSWVxgZ8z/').then(console.log)
  // Adding parameters
  await oembed('https://www.instagram.com/p/BwwSWVxgZ8z/', { maxwidth: 480 }).then(console.log)
  // non-oembed URLs resolve to null
  await oembed('https://sanity.io').then(console.log) // => null
}

run()

Providers

This module uses a local copy of the list of providers at https://oembed.com/providers.json