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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dreher-media/dm-js-lib

v0.3.5

Published

Centralized JavaScript library for Dreher.Media websites with CDN delivery

Downloads

1,219

Readme

@dreher-media/dm-js-lib

Centralized JavaScript library for Dreher.Media websites with CDN delivery.

Installation

npm install

Development

Build

npm run build

This will compile TypeScript and create dist/dm-js-lib.min.js.

Format Code

npm run format

Check formatting:

npm run format:check

Release Workflow

Standard Release

npm run release:patch   # 1.0.0 -> 1.0.1 (builds, versions, publishes, and pushes tags)
npm run release:minor   # 1.0.0 -> 1.1.0 (builds, versions, publishes, and pushes tags)
npm run release:major   # 1.0.0 -> 2.0.0 (builds, versions, publishes, and pushes tags)

The release script will:

  1. Update the version in package.json
  2. Create a git commit with the version change
  3. Create a git tag (e.g., v1.2.3) - automatically done by npm version
  4. Build the project (via prepublishOnly hook)
  5. Publish to npm
  6. Push commits and tags to remote

Patching an Old Version

To create a patch for an older version (e.g., patch v1.2.0 while main is at v1.5.0):

# 1. Checkout the old version tag
git checkout v1.2.0

# 2. Create a branch for the patch
git checkout -b patch-1.2.1

# 3. Make your fixes, then release
npm version patch
npm publish
git push origin patch-1.2.1 --follow-tags

# 4. Switch back to main
git checkout main

See RELEASE_WORKFLOW.md for detailed workflow documentation.

CDN Usage

jsDelivr automatically serves from npm with full semantic versioning support:

Pinned Version (Frozen)

<script src="https://cdn.jsdelivr.net/npm/@dreher-media/[email protected]/dist/dm-js-lib.min.js"></script>

Patch-Only Auto-Update

<script src="https://cdn.jsdelivr.net/npm/@dreher-media/[email protected]/dist/dm-js-lib.min.js"></script>

Automatically updates only on patch versions (e.g., 1.2.0 → 1.2.1), never on minor or major versions.

Version Range

<script src="https://cdn.jsdelivr.net/npm/@dreher-media/dm-js-lib@^1.2.0/dist/dm-js-lib.min.js"></script>

Updates to any compatible version (patches and minor versions, but not major).

Latest (Staging)

<script src="https://cdn.jsdelivr.net/npm/@dreher-media/dm-js-lib@latest/dist/dm-js-lib.min.js"></script>

Always points to the newest published version.

Versioning Strategy

  • All versions follow semantic versioning (semver)
  • Published versions are immutable - once published to npm, never changed
  • Version ranges (@1.2.x, @^1.2.0) automatically resolve to compatible versions
  • @latest always points to the newest published version
  • Multiple minor version lines can receive security patches independently

Project Structure

dm-js-lib/
  src/
    types/
      global.d.ts
    modules/
      [module files]
    index.ts
  dist/
    dm-js-lib.min.js
  package.json
  tsconfig.json
  rollup.config.mjs

Dependencies

  • rollup - Build tool
  • @rollup/plugin-typescript - TypeScript support
  • rollup-plugin-terser - Minification
  • typescript - TypeScript compiler
  • prettier - Code formatter

Publishing to npm

Before publishing, ensure you have:

  1. An npm account
  2. Access to the @dreher-media organization (or change the package name)
  3. Logged in: npm login

Then use the release scripts which handle building and publishing automatically.

External Dependencies (Runtime)

The library integrates with these external services (loaded separately):

  • FsCC (Finsweet Cookie Consent) - Cookie consent management
  • Webflow - Webflow CMS and interactions
  • Plyr - Video player library
  • YouTube IFrame API - YouTube player
  • Vimeo Player API - Vimeo player
  • Dailymotion Player Library - Dailymotion player
  • Swiper - Carousel/slider library (optional, for video swipers)

License

MIT