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

repco-webcomponent

v0.0.4

Published

Webcomponent to display content from a Repco node

Downloads

2

Readme

repco-webcomponent

A web component that fetches post data from a specified endpoint, displays the fetched data in cards, and provides the ability to open the original post in a new tab.

Features

  • Fetch post data from a specified endpoint.
  • Display the fetched data in cards.
  • Provide the ability to open the original post in a new tab.

Properties

The repco-post-element component has the following properties that can be used to customize its behavior:

  • theme: The theme of the post element, either "light" or "dark". The default value is "light".
  • layout: The layout of the post element, either "horizontal" or "column". The default value is "column".
  • endpoint: The GraphQL endpoint used to fetch the post data. The default value is "https://node1.repco.openaudiosearch.org/graphql".
  • count: The number of posts to display. The default value is 10.
  • _defaultThumbnail: The default thumbnail to display for posts that do not have an image as their media asset. The default value is an empty string.
  • query: The GraphQL query used to fetch the post data. The default value is a query that fetches the title, content, uid, and media assets of posts.

Examples are provided in the `dev``directory

Usage

To use repco-post-element, include the following in your HTML file:

<script type="module" src="path/to/repco-post-element.js"></script>

Then, you can use the repco-post-element component by creating an instance of it in your HTML file:

<repco-post-element
  endpoint="https://node1.repco.openaudiosearch.org/graphql"
  count="5"
></repco-post-element>

Styling

The repco-post-element component can be styled using CSS variables. The following are the default values for each CSS variable:

--card-background-color: #f7fafc
--card-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1)
--card-border-color: #cbd5e0
--dark-card-background-color: #383838
--dark-card-color: #f7fafc
--dark-card-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1)
--dark-card-border-color: #cbd5e0
--dark-card-hover-background-color: #1c1c1c
--dark-card-hover-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1)
--dark-card-hover-border-color: #cbd5e0

Building the Component

  1. Install the deopendecies using yarn:
yarn install
  1. Build the component using yarn:
yarn build
  1. [Optional] to build in watch mode:
yarn buld:watch

Development

To start a local development server, run:

yarn dev

Linting & Formatting

To lint the code, run:

yarn lint

To format the code, run:

yarn format