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

stack-events

v0.1.18

Published

Implementation of DOM events state macnihe

Readme

Overview

stack-events is a simple JavaScript module for implementing state machine arcitecture of component event handling

Installation

npm install stack-events --save

Usage

  1. You need to wrap your application with <StackEvents /> with events prop passed to it; events - is an array of string keys. Each key is a supported DOM event name that StackEvents should handle on. If no events wass passed in the component will not handle any events at all.
    ...
        return (
            <EventStack events={["keydown", "mousedown"]}>
                {this.props.child}
            </EventStack>
        );
    ...

You can use string keys or constans from stack-events/const list; The list of available methods constans are below in this readme file

  1. In the child component you shoul call withStackEvents HOC for you component.
    import React from 'react';
    import { withEventStack } from '../component';

    ...

    class MyComponent extends React.Component {
        ...
    }

    ...

    export default withEventStack(MyComponent);

After HOC your componen will receive two methods: pushEvents and popEvents.

  1. Use pushEvents into component's componentDidMount life method to push your component event handlers to stackEvents stack;
    ...

    componentDidMount() {
        this.props.pushEvents({
            "keydown": this.handleKeyDown,
            "keyup": this.handleKeyUp
        })
    }
    
    ...
  1. Don't forget to use popEvents in component's componentWillUnmount method to pop events from the stack.
    ...

    componentWillUnmount() {
        this.props.popEvents();
    }
    
    ...

Events constants

  • ABORT
  • ANIMATIONEND
  • ANIMATIONITERATION
  • ANIMATIONSTART
  • BLUR
  • CANPLAY
  • CANPLAYTHROUGH
  • CHANGE
  • CLICK
  • CONTEXTMENU
  • COPY
  • CUT
  • DBLCLICK
  • DRAG
  • DRAGEND
  • DRAGENTER
  • DRAGEXIT
  • DRAGLEAVE
  • DRAGOVER
  • DRAGSTART
  • DROP
  • DURATIONCHANGE
  • EMPTIED
  • ENCRYPTED
  • ENDED
  • ERROR
  • FOCUS
  • FOCUSIN
  • FOCUSOUT
  • HASHCHANGE
  • INPUT
  • INVALID
  • KEYDOWN
  • KEYPRESS
  • KEYUP
  • LOAD
  • LOADEDDATA
  • LOADEDMETADATA
  • LOADSTART
  • MOUSEDOWN
  • MOUSEENTER
  • MOUSELEAVE
  • MOUSEMOVE
  • MOUSEOUT
  • MOUSEOVER
  • MOUSEUP
  • PASTE
  • PAUSE
  • PLAY
  • PLAYING
  • POPSTATE
  • PROGRESS
  • RATECHANGE
  • RESET
  • RESIZE
  • SCROLL
  • SEEKED
  • SEEKING
  • SELECT
  • STALLED
  • SUBMIT
  • SUSPEND
  • TIMEUPDATE
  • TOUCHCANCEL
  • TOUCHEND
  • TOUCHMOVE
  • TOUCHSTART
  • TRANSITIONEND
  • UNLOAD
  • VOLUMECHANGE
  • WAITING
  • WHEEL