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

geb

v0.2.0

Published

geb is an abnormal great EventBus for Javascript Web/Node.

Downloads

9

Readme

geb (global-event-bus)

geb is an abnormal and great EventBus for Javascript Web/Node.

Features

  • Instantiate Object on call for better start-up-time
  • Better overview

Short simple introduction

  • Definition
var f = function(arg) {console.log("hello "+arg);};
eb.eb('testCase.firstCase.test',f);
  • Run from everywhere
eb.testCase.firstCase.test('there');
// will print: 'hello there'

Install

npm install geb --save

Include

Node

  var geb = require('geb');
  new geb(); //add eb to Global and return it
  //var eb = new geb(false); //won't add eb to global, maybe for security reasons.

Web

Use the Browserify boundle.js in folder node_modules/geb/lib/boundle.js

  <script language='javascript' type='text/javascript' src='<path_to>/boundle.js'></script>

Now eb is globally (on window) available.

Examples

eb()

Info

After implement, you could call it with eb. You could store your events on separate domains. Every domain contains the eb() function. The function only knows his own domain and his followed domains.

The eb() function creates-/removes- Domains, add-/remove (multiple) event definitions and add thisArg to the domains and/or event(s).

eb() will operate on and return his own current domain.

Function definition

  • parameter {Object}: adds Option to Domain and functions
  • parameter {String}: define the Domain
  • parameter {Function}: adds function to Domain.methode
  • return {Object}: current Domain

Without domain (String): add to current domain

Without function: add domain and/or option

Only Object: adds option to current domain

You could add more then one function to damain.

  • The thisArg option on create a function will be used on call, not the domain thisArg.
  • The domain thisArg will only be used, if there is no thisArg on function create.

Function examples

  // eb.debug=true;

  // define an Object
  var o = {
    f: function(arg) {
      console.log("hello "+arg);
    }
  }

  //set testCaseEB to subdomain and add function test with thisArg to subdomain
  var testCaseEB = eb.eb('testCase.firstCase'); //reg. domain
  testCaseEB.eb('test',o.f);
  testCaseEB.thisArg = o;

  //OR same in one Statement:
  var testCaseEB = eb.eb('testCase.firstCase.test',o.f,{thisArg:o});

  //call it with:
  testCaseEB.test()

  //OR globally
  eb.testCase.firstCase.test()

  //Add option permanent to domain testCase und above
  eb.testCase.firstCase.eb({thisArg:obj}).test('bla')

  //Removes all sub function from domain
  eb.eb({remove:true});

  //Remove testCase Domain
  eb.eb({remove:'testCase'});

IF

  var obj1 = {
    id: 1,
    call: function() {
      console.log("Hello from obj1");
    }
  }
  var obj2 = {
    id: 2,
    call: function() {
      console.log("Hello from obj2");
    }
  }

  eb.eb('test',obj1.call,{thisArg:obj1});
  eb.eb('test',obj2.call,{thisArg:obj2});

  // will only log 'Hello from obj1', the if object checks the thisArg object
  eb.eb({if:{id:1}}).test()

Instantiate Object on call

Instantiate Objects only when you need them. For better startup-time.

test-object.coffee

module.exports =
class Test
  constructor: (@info) ->
  call: (arg) ->
    console.log "#{@geb} #{@info} #{arg}"
  setInfo: (@info) ->

example1.js normal (lazy startup-time)

var TestObject = require('./test-object')
var instance = new TestObject('hello')
eb.eb('test',{
  thisArg: instance,
  call: instance.call,
  setInfo: instance.setInfo
});
eb.test.call('world'); //print: hello world

example1.js instance on call (better startup-time)

eb.eb('test',{
  instance: {
    watch: ['call','setInfo'],
    create: function() {
      var TestObject = require('./test-object');
      return new TestObject('hello');
    }
  }
});
eb.test.call('world'); //print: hello world
// will instantiate Test (with readFile...) after call
// and execute call