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

sjf-scroll

v1.0.3

Published

A simple custom scroll framework

Readme

sjf-scroll

A simple custom scroll npm package. It is made according to the browser's scroll bar. So it can support most browser's feature.For example, it supports the mousewheel, drag and click event etc.

Usage

  1. Install the npm package

    npm install sjf-scroll

  2. Add the script to initialize sjfScroll after dom onloaded

    import sjfScroll from 'sjf-scroll' sjfScroll.initScroll()

  3. Add the entrance of the sjf-scroll.

* The sjfScroll.js is to search the element with the attribute of 'sjf-scroll'. And rewriting the dom structure to realize the function

* The attribute `max-height` is set to show the scroll bar when sjf-scroll content's height beyond it.

* The default value of attribute `max-height` is 150 and the value you set best to greater than or equal to 150

options

The sjf-scroll supports options for users to set

{
  delay: 1000, // default value
  gradient: 10 // default value
  minHeight: 30 // default value
}
  • The option delay is to set the time the mouse is suspended in the sjf-scroll before executing other events (鼠标停留在sjf-scroll多久才会执行滚轮事件或者键盘事件)

  • The option gradient is to set the change unit of wheel or keydown events (滚一下滚动10px或者上翻10px)

  • The option minHeight is to set the min height of the sjf-scroll-content(the part is to show the progress of scroll)

  • the user to set the options API is sjfScroll.setOptions(param)

    the param is a object which contains one attribute or more of options

  • the user can load some other thing through the sjfScroll.scroll to set the function of callback

And now you can use sjf-scroll in your project easily