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

youtube-widget-ui

v1.3.2

Published

library to add videos, profile information or search videos from your youtube channel, add any of these lightweight and powerful components to your web project.

Downloads

3

Readme

Youtube Widget Ui

library to add videos, profile information or search for videos from your youtube channel, add any of these lightweight and powerful components to your web project. This library uses the youtube api v3

🚀 Features

  • Component y-profile-info to display the information of your youtube channel
  • Component y-video-list, to list the videos of your youtube channel
  • y-search component, search for videos from your youtube channel

🖥️ Installation

This library can be used in Angular, React, or Vue. So next we will see how to install it. In the next few days I will be adding the installation documentation for React and vue

🔴 Angular

If you are using or working with a javascript project with node.js to install this library follow the steps below

Installing

  npm install --save youtube-widget-ui

Using

In the app.module.ts we add the CUSTOM_ELEMENTS_SCHEMA

schemas: [CUSTOM_ELEMENTS_SCHEMA]

The next thing to do is import the defineCustomElements of the component itself

import { defineCustomElements } from 'youtube-widget-ui/loader';

And then we add it

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));
  defineCustomElements(window);

In future updates, the documentation to install in react and vue will be added

🧱 Knowing the components

Next we will know the components for what they are used and how to use each one of them

y-profile-info

This component is for you to place your channel information like the name, your nickname and the description of your channel.

Next we will see the inputs that this component has

Properties

| Property | Attribute | Description | Type | Default | | -------------------- | --------------------- | ----------- | --------- | ----------- | | apiKey | api-key | youtube api key | string | undefined | | channelDescription | channel-description | add a different description to the one that comes by default | string | undefined | | channelImage | channel-image | url of the image of your channel | string | undefined | | customDescription | custom-description | in true to activate the channel-description and in false to bring the description by default | boolean | undefined |

NOTE all these attributes have to contain a value, otherwise the component will not work correctly

y-video-list

With this component you can show your first 50 videos, selecting a video will redirect you to the video on YouTube

Properties

| Property | Attribute | Description | Type | Default | | ----------- | ------------ | ----------- | -------- | ----------- | | apiKey | api-key | youtube api-key | string | undefined | | channelId | channel-id | channel id | string | undefined |

In the same way as the previous component, for the component to work correctly it is necessary to give a value to all its attributes

y-search

With this component search for any video from your youtube channel

Properties

| Property | Attribute | Description | Type | Default | | ----------- | ------------ | ----------- | -------- | ----------- | | apiKey | api-key | youtube api-key | string | undefined | | channelId | channel-id | channel id | string | undefined |

Events

| Event | Description | Type | | -------------- | ----------- | --------------------- | | searchResult | emits an event that returns the search result | CustomEvent<Search> |

Next I show you how you can access this event and obtain the result.

In order to access the result of the event, they are handled like any other event in Angular, as can be seen in the following example.

<y-search
  (searchResult)="search($event)"
  api-key="your api-key"
  channel-id="your channel id"
></y-search>

This is not the end of the library, we will add more components and improve little by little. ENJOY THE LIBRARY!!! 🥳