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

@yunlefun-home/air-conditioner-widget

v0.4.3

Published

Native Web Component widget for Yun Air Conditioner.

Readme

Air Conditioner widget

A framework-independent Web Component with a floating air conditioner and a collapsible remote. Supports ESM, CommonJS and TypeScript; no React or Vue host is required.

npm (recommended)

npm install @yunlefun-home/air-conditioner-widget
import { cdnAssets, mountAirConditioner } from '@yunlefun-home/air-conditioner-widget'

// On the client, after the DOM is ready. Importing the package during SSR is safe.
const widget = mountAirConditioner(document.body, {
  ...cdnAssets,
  placement: 'top-right', // 'top-left' | 'top-right' | 'inline'
  storageKey: 'my-blog:ac',
  enableAudio: false,
})

// On component / route teardown, release listeners and audio:
// widget.remove()

cdnAssets explicitly loads fonts, audio and the logo from jsDelivr, pinned to the exact version of the installed npm package. Your application bundles the JavaScript itself. Omit it and provide assetsBaseUrl and logoUrl to self-host assets. Importing the package does not automatically mount or fetch anything.

You can also call defineAirConditionerElement({ ...cdnAssets, enableAudio: false }), then render <air-conditioner-widget placement="top-right"></air-conditioner-widget>.

Script (no build required)

Add this exact-version URL to a site's shared header or footer:

<script defer src="https://cdn.jsdelivr.net/npm/@yunlefun-home/[email protected]/dist/embed/embed.js" data-placement="top-right"></script>

Use data-placement="top-left" for the left corner, data-audio="true" for audio, and data-storage-key="my-blog:ac" for a local storage key. Audio is disabled by default in the script installer. The remote opens on click, touch, Enter, or Space and closes with Escape. Loading the script twice keeps a single widget.

Upgrade by changing the exact version; avoid latest in production. Try the installation demo.

Self-hosting and offline use

The npm package includes all runtime assets. Copy its dist/embed/ directory into your site's static directory, for example:

mkdir -p public/widget
cp -R node_modules/@yunlefun-home/air-conditioner-widget/dist/embed/. public/widget/

For the API, replace ...cdnAssets with assetsBaseUrl: '/widget/assets' and logoUrl: '/widget/yun-logo.svg'. Include your deployment prefix if applicable. For plain HTML use <script defer src="/widget/embed.js"></script>. Keep the assets next to the script. The included index.html is the official CDN installation demo; omit it for a strictly offline site.

For use from another origin, serve these files with Access-Control-Allow-Origin: *. Sites with a Content Security Policy must allow the chosen origin for scripts, fonts, images, media and fetch, and permit the widget's inline styles.

From source, run pnpm -C packages/widget build. pnpm react:build also includes the installer under packages/react/dist/widget/.

Source and assets

  • Source: https://github.com/YunYouJun/air-conditioner (MIT; see LICENSE).
  • Font: Digital-7 by Style-7, described upstream as free for personal use.
  • Fan recording: Air Extractor Fan by InspectorJ, processed by this project.
  • The bundle copies the font, button/start sounds and logo from this repository's packages/react/public/. Third-party assets retain their own licenses.