npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

embedo

v1.14.0

Published

Embeds third party content to DOM with perks

Downloads

10,446

Readme

embedo npm

Embedo adds a layer on top of third party embed APIs while ensuring best practices and native guidelines for each component. It takes cares of resizing the container, emitting necessary events and with support for native and external options to be pass along.

Docs: Options / API / Events / Usage / Changelog

What's currently supported?

  • Facebook URLs containing page, post, photos, videos or comments
  • Twitter URLs containing user timeline and tweets
  • YouTube and Vimeo videos URLs
  • Instagram URLs containing posts and videos
  • Pinterest URLs containing board, profile and pins
  • Google Maps URLs containing cordinates to a location
  • Embeds other urls like Github Gists, Soundcloud, Spotify or PDF, MP4, Webm, ... as iframe
  • Embeds any URL that fulfils HTTP access control (CORS) policy
  • Extended plugin support for additonal oembed services
  • Supports IE10+ and all modern browsers

Installation

NPM / Yarn

$ npm install embedo --save
$ yarn add embedo

Bower

$ bower install embedo

CDN

Alternatively, import using CDN while updating version as per requirements from any script below:

<script type="text/javascript" src="https://unpkg.com/embedo/embedo.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/embedo[@VERSION]/embedo.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/embedo[@VERSION]/plugins/[@PLUGIN_NAME]/[@PLUGIN_NAME].embedo.min.js"></script>

Setup

CommonJS / AMD

import Embedo from '/path/to/vendor';

// Initialize Embedo class object
const embedo = new Embedo({
 facebook: {
    appId: 'my_app_id', // Enable facebook SDK
    version: 'v2.10'
  },
  twitter: true,  // Enable twitter SDK
  instagram: true,  // Enable instagram SDK
  pinterest: true  // Enable pinterest SDK,
  googlemaps: {
    key: 'my_api_key' // Enables google maps API
  }
});

// Then call .load() method from anywhere
embedo.load(<HTMLElement[object]>, <URL[string]>, <options[object]*optional>);

// OR Chaining methods and callback
embedo
  .load(HTMLElement, URL, options)
  .done(Function)
  .fail(Function)

// OR storing in a variable
let my_embedo = embedo.load(HTMLElement, URL)
my_embedo.done(Function);
my_embedo.fail(Function);

Also, an example can be found here.

HTML

...

<body>
  <div data-embedo-url="[@URL_TO_EMBED]"></div>
  <div data-embedo-url="[@URL_TO_EMBED]" data-embedo-[@OPTION_KEY]]="[@OPTION_VALUE]"></div>
</body>

...

<script>
  new Embedo({
    facebook: {
      appId: 'my_app_id', // Enable facebook SDK
      version: 'v2.10'
    },
    twitter: true,  // Enable twitter SDK
    instagram: true,  // Enable instagram SDK
    pinterest: true  // Enable pinterest SDK,
    googlemaps: {
      key: 'my_api_key' // Enables google maps API
    }
  });
</script>

Also, an example can be found here.