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

jostack

v0.0.9

Published

Web OO Framework with node, express, and browser integration

Readme

jostack

Core webapp framework built for NodeJS and plugins for MongoDB, Express, AngularJS

The forms a core REST framework for Javascript modules which can be leveraged on both NodeJS and the browser context. The core modules are function prototypes designed to be loaded on demand using RequireJS. A schema handler identifies the appropriate function prototype (ie. requirejs module) to handle each document type. Although there are other frameworks for bootstrapping end-to-end application development, this project strives for more of a pattern-based approach to building out a framework which can grow and flex with each organization's style, limiting framework lock-in situation. The client-side dependencies are requirejs, and angularjs. For the server-side, requirejs, mongodb, and express are the dependencies.

Currently, the meta data is included with the document structure in the form:

{ meta: { moduleName: '' }, doc: { } }

A schema plugin will be provided soon to allow client specify specific module-to-doc schema mappings separate for the document collection.

Install

npm install

package.json

dependencies: {
    "jostack": "~0.0.1"
}

config.json

{
    "dburl": "mongodb://localhost:27017/<my database>",
    "collection": "<my collections>",
    "port": "<express port to listen on>",
    "wwwdir": "/full/path/to/public/dir",
    "loader": "loader_express|loader_node|<some custom loader>",
    "db": "db_mongo|<another backend db>"
}

require.config.js

Create config.js file to specify your .js file location, and module definitions.  For example:

requirejs.config({
    baseUrl: '/js',
    enforceDefine: false,
    logLevel: 1,
    paths: {
        angular: 'https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular',
        angularSanitize: 'https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular-sanitize',
        domReady: 'domready'
    },
    shim: {
        angular: {
            exports: 'angular'
        },
        angularSanitize: {
            deps: ['angular']
        }
    }
});

The above config.js will define core module definition for loading angular.  
Add any specific module definitions that do not exist in the default directory 
as defined by baseUrl (see above).

Class Definitions

Create .js class files in the format compatible with requiresjs module definitions.  For example:

define(['article'], function (Article) {

    function MyArticleDerivedClass() {
        Article.apply(this, arguments);
    }

    MyArticleDerivedClass.prototype = Object.create(Article.prototype);
    MyArticleDerivedClass.prototype.constructor = Article;

    return MyArticleDerivedClass;
});

//The above class definition extends the class Article (supplied by core jostack).

Bootstrapping

Bootstrapping begins with a standard main.js module which requirejs loads.  For jostack, the module uses
a LoaderFactory to initiate as session with a db (ie. model) and context (ie. browser or node).  
An example usage for the browser (context) with angular (db/model) is as follows:
define([], function () {
    requirejs(['loader_factory'], function (LoaderFactory) {
        var lf = new LoaderFactory();
        lf.create('loader_browser', 'db_angular', function (loader) {
            loader.init([{
                criteria: {
                    'meta.category': {
                        '$in': ['MyArticleDerivedMetaCategory']
                    }
                }
            }], function (db) {
                console.log('loaded mvc');
            });
        });
    });
});
REST calls can be made from a one of the client/db derived classes (currently only db_angular is available)
Example call below:

    myRestCallExample = function () {
        this.db.update({meta: this.meta, doc: this.doc}, function (results) {
            $this.doc.statusMessage = (results && results.ok) ? "Saved" : "Error.  Not saved!";
        });
    }
Examining the db_angular.js, notice the REST calls are $http.post() requests following a distinct schema format:
    {
        operation: 'update | insert | delete | query'
        payload: {<your data object>}
    }
For query operations, db_angular will update the default $scope root variable resultset with the query results.  
For update, insert, or delete operations, the results are status information.
For the main .html file, it should only include a <script> tag for requirejs and the require.config.js file.  
Here is the general format:

<!DOCTYPE html>
<html lang="en">
<body ng-controller="Controller">
    <div ng-repeat="container in resultset | filter:{'meta': {'category': 'MyArticleDerivedMetaCategory'}}">
        <div>{{ container.doc.myDataItem }}</div>
    </div>

    <script data-main="js/main" src="js/requirejs-2.1.16.min.js"></script>
    <script src='js/require.config.js'></script>
</body>
</html>

Where the 'Controller' is the default angular controller located in db_angular.js.  The ng-repeat example shows
how to iterate over the 'query' operation result set (named $scope.resultset in the Controller class). 
Each result item will contain a doc object and a meta object.  The doc object is your custom scope data, 
and the meta object container the class/module and any other meta-data associated with the class 
representing the doc data.