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

groupjs

v0.1.3

Published

An inheritance implementation pattern of grouping javascript objects for instances.

Readme

About groupJS

GroupJS is a javascript module for structuring javascript modules into a "group". Simply put, we want a group as a component which is composited by javascript modules which can be overriden.

For example, group A includes module A1, A2 and A3. A1, A2 and A3 interact internally. You can create module A11 replace A1 in group A.

Group A can be "inherited". E.g. you create group AA with the same function as group A. group AA can extend its method and attributes without interfering with group A.

Documentation

Usages

Object Inheritance

  • obj.create(<object id>) - Create a new object. should be identifier of an object.

    var newObj = Grp.obj.create('newObj');
    var newObj_1 = newObj.create('newObj_1');
  • obj.extend( obj1 [, obj2, ......] ) - extend object's attributes. If attribute exists, it will be overriden.

    var newObj = Grp.obj.create('newObj');
    newObj.extend({
        newAttribute: function() {
        alert('this is a new attribute');
        },
    });
  • obj.reservedAttr - Array of string to reserved attributes or methods names for this module.

  • obj.init() - initialize local variable

Group

  • group.create(<group id>) - create a new group

  • group.join(<member or sub-Group>[, <member2 or sub-Group2>...]) - join a memeber into this group. If member name exists, the member will be overriden.

    //create a member
    var newObj = Grp.obj.create('newObj');
    newObj.extend({
        newAttribute: function(opt) {
            alert('this is a new attribute for ' + opt._id||'');
        },
    });
    
    //create a group
    var newGrp = Grp.group.create('newGrp');
    newGrp.join(newObj);
    newGrp.extend({
        promptAlert: function(opt) {
            this.call('newObj', 'newAttribute', opt );
        },
    });
    
    var grpTest = newGrp.create('grpTest');
    var opt = { name: 'grpTest_Name' };
    grpTest.promptAlert(opt);
  • group.call() - call its own member command. If inherited, the member will still be called based on parents list. return its result or the last call's result.

    • For group level, this.call(<member or memberID>, <methodName>, opt)
    • For member level, this.group.call(<member or memberID>, <methodName>, opt)
  • group.upCall() - call its own member command or find in upper group's member command. First hit will be return.!!!

    • For group level, this.upCall(<memberName>, <methodName>, opt)
    • For member level, this.group.upCall(<memberName>, <methodName>, opt)
  • group.downCall() - call its own member command or find in sub group's member command. First hit will be return.!!!

    • For group level, this.downCall(<memberName>, <methodName>, opt)
    • For member level, this.group.downCall(<memberName>, <methodName>, opt)
  • group.group - for member, it refers to its group; for group, refers to its parent group.

  • group.members() - show a map of this group's members.

  • group.getMember(memberName[, memberMap]) - get a member by name.

  • group.override(newMember[, memberMap]) - To be overridden the member with the same _id. Note: Do not use it

Examples

  1. Check the test cases and you might get some idea

  2. Check example folder

  3. In node.js npm install groupjs

    var Grp = require('groupjs');
  4. with requirejs require(['groupjs'], function(Grp){});

Build

grunt

Release

grunt
grunt test

git add . -A
git commit -m ""
git push

Change version in bower,
git tag -a 0.1.03 -m "Tagging 0.1.03"

To npm, change version number
npm publish ./

Register in bower
bower register groupjs git://github.com/mainnote/groupJS.git

Test

grunt test
or
grunt watch

Contributors

George Zhang < [email protected] >