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

modly-js

v0.0.14

Published

Lightweight modal window library

Downloads

61

Readme

Modly.js

Dependency-free, lightweight and responsive modal window library

Build Status

Installation

Install Modly.js as a NPM dependency or grab the latest version from the CDN.

NPM:

# yarn
yarn add modly-js --dev

# npm
npm i modly-js --save-dev

CDN:

<script src="https://cdn.jsdelivr.net/npm/modly-js"></script>

Usage

A new Modly will pop up as soon as you instanciate it:

new Modly()

The above is the most basic version that is allowed (without any options).

The constructor also supports passing an options object:

new Modly({ content: "Hi there from modly!" });

Options:

animation.enabled - (true, false) Defines, if the Modly should be shown with or without an animation. animation.duration - (duration in ms) Defines the duration of the animation (only relevant, if animation.enabled is set to true).

className - (string) Additional custom class name(s) which will be added to the Modly wrapper.

closeButton.enabled - (true, false) Defines if the close button should be shown or hidden.

content - (string, HTMLElement) If a string will be passed, that's going to be the content, otherwise you can i.e. use document.querySelector() to grab the HTML element you want to set as content.

overlay.enabled - (true, false) Defines, if the wrapping overlay should be enabled (background color and will dispose the Modly instance on click) or disabled (no background color and won't dispose the Modly instance on click).

position - (top-left, top, top-right, right, bottom-right, bottom, bottom-left, left, center) Defines where to position the Modly. If the content of the Modly is bigger than the current screen size, it'll be positioned vertically to the top.

sizes.width - (number in px) Sets the maximum width of the Modly.

theme - (light) Defines the theme for the Modly. Currently, only light is implemented.

Default options

For each of the options above, there's a pre-defined default value, which will be used, if not overridden in the options:

const defaults = {
  animation: {
    enabled: true,
    duration: 300
  },
  className: "",
  closeButton: {
    enabled: true
  },
  content: "",
  overlay: {
    enabled: true
  },
  position: "center",
  sizes: {
    width: 900
  },
  theme: "light"
};