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 🙏

© 2024 – Pkg Stats / Ryan Hefner

emmitt

v0.0.2

Published

Event emmiter for everything.

Downloads

13

Readme

Emmitt - Event Emitter for Everything

Emmitt is a small Javascript library that can emit events on any Javascript object. It works with

  1. Plain Javascript objects (POJOs)
  2. jQuery wraped DOM elements
  3. Backbone models or objects extended with Backbone.Event
  4. Raw DOM elements

Usage

Simple example

var E = require('emmitt');

var obj = new SomeObject();
E.on(obj, 'refresh', function(data){
  console.log(obj, 'was refreshed with', data);
});

// then later on...
E.emit(obj, 'refresh', data)

If the object in question is a jQuery wrapped DOM element, a Backbone model, or a raw DOM element, event handling will delegate properly to their respective methods for event handling.

API

  • on(object, event, handler) - registers an event handler for a given event on an object.
  • off(object, event, [handler]) - unregisters an event handler. If handler is not provided, removes all event handlers for the given event. Aliased to removeListener.
  • emit(object, event, [...args]) - emits an event on an object with the given arguments. Aliased to trigger.
  • allOff(object) - remove all event handlers from an object. Aliased to clearAllListeners.

Support

  • Node
  • Standard compliant browsers
  • Non-standard IE 7 and up