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

enofjs

v2.0.1

Published

Enhancing javascript

Readme

EnoFJS

Build Status Code Climate Coverage Status Inheritance

Javascript supports private and public out of the box. However inheritance is often claimed impossible or done with prototype.

While inheriting with prototype is not necessarily bad, it however implies that all inheritable properties have to be public and all properties should be public in case a function in the prototype needs to access it.

To make this possible, EnoFJS implements a ClassFactory, handling all the trouble of scoping and inheriting.

var Dog = clazz(function Dog(name){
    this.extend = 'Animal';

    this.private = {
        name: null
    };

    this.protected = {
        nickName: {
            getSet: null
        }
    };

    this.public = {
        barkName: function barkName(){
            return 'Woof, my name is ' + this.private.name +
                ', but you can call me ' +
                this.protected.nickName + '!';
        }
    };

});
var dog = new Dog('fluffy duffy');
dog.setNickName('fluffy');
expect(dog.barkName()).
    toEqual('Woof, my name is fluffy duffy' +
            ', but you can call me fluffy!');

LinkedHashMap

A LinkedHashMap has the advantage of a LinkedList, able to quickly add or remove a Node between already existing nodes. However a LinkedList is slower in finding an entry in the middle of the list, because it has to search through the entire list!

With the implementation of a LinkedHashMap, it keeps the ability to insert or remove nodes like a LinkedList. For searching the implementation of a HashMap is used. This way you have best of both worlds!

var list = new LinkedHashMap();
list.add(0, 'one');
list.add(1, 'two');
list.add(2, 'three');
expect(list.get(1).getValue()).toEqual('two');
list.addAfter('an non integer key', 'four');
expect(list.get('an non integer key').getNext().
                    getValue()).toEqual('three');

Serializable

When sending information over the line in json format, the Serializable clazz can help. This Class will help you in serializing your classes into a json format.

The class also helps you deserialize a serialized object in json format.

var SerializableObject = clazz(function SerializableObject(){
    this.extend = 'Serializable';

    this.constructor = function constructor(serialized){
        this.super(serialized);
    };
});

WhereIt

The whereIt is an extention for the Jasmine test framework. Often you have a test cases where the same process will be executed with different parameters, expecting different results. The whereIt assists in doing this with a simple configuration!

Configuration will be matched to the variable names!

whereIt('should add', function addNumbers(x, y, result){
    expect(calulator.add(x, y)).toEqual(result);
}, [
    {
        x: 1,
        y: 2,
        result: 3
    },
    {
        y: 200,
        x: 2,
        result: 202
    }
]);

ArrayConverters

In modern browsers TypedArrays are introduced. The literal array [] or new Array() do not support the ArrayBuffer out of the box. To convert an literal array into an Uint32Array this extention on the Array.prototype is brought to live.

Usage:

var array = [1,2,3,4];
var uInt32Array = array.toUint32Array();
console.log(uInt32Array[0]); // 67305985
uInt32Array[0] = uInt32Array[0] + 1;
array.readUint32ArrayIn(uInt32Array);
console.log(array); // [2, 2, 3, 4]