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

innerer

v0.1.2

Published

Check element vertical position within the viewport.

Downloads

27

Readme

Install

npm install innerer --save

Usage

import { createInners } from "innerer";

// in your code 
// to start monitoring your innerer elements
createInners(callback, "#element-id");
// You need to destroy the listeners before leaving the document
destroyInners();

or

import Innerer from "innerer";

// in your code 
Innerer.create(callback, "#element-id");
// You need to destroy the listeners before leaving the document
Innerer.destroy();

In your HTML / Template

<div data-innerer="tagName"></div>

Parameters

callbak is invoked when document is scrolling or resizing with one argument as an object with the information of every inner-tag.

First Argument (type: Object)

List of properties, types and definition

tag property
  tag: {
    type: String,
    definition: Tag name defined on the data-innerer attribute, ex. <div data-innerer="tag-name"></div>  
  }
direction property
  direction: {
    type:String,
    definition: document scroll direction, available options: ["up", "down"]
  }
position property
position: {
    status: {
      type: String,
      definition: Available options ["bottom-outer", "entered", "top-outer"]
    },
    percentageInTransition: {
      type: Number
      definition: 0 means element is outside the viewport, 1 means element is inside the viewport, between 0 and 1 means element is entering or leaving the viewport [from bottom to top, or from top to bottom].
    },
    percentageInPosition: {
      type: Number,
      definition: 0 means top element is in the top of the viewport, 1 means top element is in the bottom of the viewport, 0.5 means top element is in the middle of the viewport.
    },
    percentageOutside: {
      type: Number,
      definition: 0 means top element is in the bottom or inside of the viewport, 1 means top element is one height element or greater away outside from the bottom or top of the viewport, between 0 an 1 means element top is one height element near the bottom or top of the viewport.
    } 
}
centered property
centered: {
    status: {
      type: String
      definition: available option: ["below_center", "above_center"]
    },
    percentage: {
      type: Number
      definition: 1 means element center y in the center of the viewport, 0 means element center is in the top or bottom of the viewport.
    }
}
clientRect property
clientRect: { 
    top: {
      type: Number,
      definition: same as getBoundingClientRect.top
    },
    right: {
      type: Number,
      definition: same as getBoundingClientRect.right
    },
    bottom: {
      type: Number,
      definition: same as getBoundingClientRect.bottom
    },
    left: {
      type: Number,
      definition: same as getBoundingClientRect.left
    },
    width: {
      type: Number,
      definition: same as getBoundingClientRect.width
    },
    height: {
      type: Number,
      definition: same as getBoundingClientRect.height
    }
}

[querySelector](optional) A query selector where the innerer will start searching for data-innerer attributes, if not present it will start searching for data-innerer attributes in the whole document.

Use constant values

You can import and use the constant values to make work your conditions for each Innerer

export const DIRECTION_UP = 'up';
export const DIRECTION_DW = 'down';
export const ENTERED = 'entered';
export const TOP_OUTER = 'top-outer';
export const BOTTOM_OUTER = 'bottom-outer';
export const BELOW_CENTER = 'below_center';
export const ABOVE_CENTER = 'above_center';
In your code
import { 
    DIRECTION_DW, 
    DIRECTION_UP,
    ENTERED,
    BOTTOM_OUTER,
    BELOW_CENTER,
    ABOVE_CENTER
} from "innerer";

Live Example

Vuejs using Innerer package

Author

Jose Burgos [email protected]