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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ddysiodev/widgets

v0.1.0

Published

Official Web Components widgets for the DDYS Open API.

Downloads

86

Readme

DDYS Widgets

English | 简体中文

DDYS Open API 官方 Web Components 组件库。

官网:低端影视

站长可以把搜索框、最新影片、热门影片、影片日历、影片卡片和片单直接嵌入到任意网站里。

快速开始

<script type="module" src="https://cdn.jsdelivr.net/npm/@ddysiodev/[email protected]/dist/index.js"></script>

<ddys-search></ddys-search>
<ddys-latest limit="12"></ddys-latest>
<ddys-hot></ddys-hot>
<ddys-calendar></ddys-calendar>

CDN 地址:

https://cdn.jsdelivr.net/npm/@ddysiodev/[email protected]/dist/index.js
https://unpkg.com/@ddysiodev/[email protected]/dist/index.js

安装

npm install @ddysiodev/widgets
import { defineDdysWidgets } from '@ddysiodev/widgets';

defineDdysWidgets();

组件

搜索

<ddys-search q="星际" type="movie" per-page="8"></ddys-search>

属性:qtypeplaceholderper-pagemin-charsdebounceinstantshow-submitsubmit-labellayout

最新影片

<ddys-latest type="movie" limit="12" layout="grid"></ddys-latest>

属性:limittypegenreregionyearlayoutcolumnsshow-postershow-rating

热门影片

<ddys-hot limit="10" layout="list"></ddys-hot>

属性:limittypegenreregionlayoutshow-sources

影片日历

<ddys-calendar year="2026" month="7"></ddys-calendar>

属性:yearmonthviewshow-navshow-postercompact

影片卡片

<ddys-movie-card slug="interstellar" layout="horizontal" show-intro="true"></ddys-movie-card>

属性:sluglayoutshow-introshow-metashow-sourcespostertitle

片单

<ddys-collection per-page="6"></ddys-collection>
<ddys-collection slug="best-sci-fi" per-page="12"></ddys-collection>

属性:slugpageper-pagelayoutshow-descriptionshow-load-more

全局属性

所有组件都支持:

| 属性 | 默认值 | 说明 | | --- | --- | --- | | api-base | https://ddys.io/api/v1 | API 基础地址 | | site-base | https://ddys.io | 链接基础地址 | | theme | auto | autolightdark | | locale | zh-CN | zh-CNen | | target | _blank | 链接打开方式 | | cache-ttl | 300 | 客户端缓存秒数 | | timeout | 15000 | 请求超时毫秒数 | | compact | false | 紧凑布局 | | hide-brand | false | 隐藏底部来源链接 | | loading-text | 自动 | 自定义加载文案 | | empty-text | 自动 | 自定义空状态文案 | | error-text | 自动 | 自定义错误文案 |

自定义 API 地址

如果网站通过自己的缓存代理转发 DDYS API,可以使用 api-base

<ddys-latest api-base="https://example.com/ddys-api" limit="12"></ddys-latest>

公开展示组件可以直接使用公开读接口。创建或修改用户数据的功能更适合放在服务端、Worker 或 CMS 后台里实现。

事件

组件会派发可冒泡的 CustomEvent

| 事件 | detail | | --- | --- | | ddys:ready | { elementName } | | ddys:loading | { endpoint, query } | | ddys:loaded | { endpoint, data, meta } | | ddys:error | { endpoint, message, status } | | ddys:empty | { endpoint, query } | | ddys:select | { item, url } | | ddys:search | { q, type, page } | | ddys:suggest | { q, data } |

document.querySelector('ddys-latest').addEventListener('ddys:loaded', (event) => {
  console.log(event.detail.data);
});

样式定制

组件使用 Shadow DOM,并开放 CSS 变量:

ddys-latest {
  --ddys-color-bg: #ffffff;
  --ddys-color-panel: #fafafa;
  --ddys-color-text: #171717;
  --ddys-color-muted: #666666;
  --ddys-color-border: #e5e5e5;
  --ddys-color-accent: #111111;
  --ddys-radius: 8px;
  --ddys-gap: 12px;
}

常用 partrootheadertitlegridlistitempostermetalinkloadingemptyerrorbrand

示例

本地示例在 examples/ 目录:

examples/basic.html
examples/search.html
examples/latest-hot.html
examples/calendar.html
examples/collection.html
examples/custom-theme.html

开发

node scripts/build.mjs
node --test test/*.test.mjs

线上 API smoke test:

node test/live-smoke.mjs