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

hometree

v0.1.1

Published

Server framework for modular applications

Downloads

4

Readme

limby

I made this because I was doing the same thing over and over and over....

See, I use a main application, and then many sub applications for each section. I usually want each section to have it's own public and vendor directories; it's own front-end coffeescripts that get compiled and served as javascripts; and a bunch of other middleware.

Limby allows you to create a middleware set that is used independently in each sub-module ( limb ).

npm install limby

To use terminal commands such as limby g migration, limby migrate, limby rollback --step=3, limby redo, install with -g

User signup / login integration

Limby handles a complete user system, including sign up, login, logout, forgot password, edit account, etc.

It comes with overrideable default views for these user managment tasks. They can be fully overriden, or extended.

It's easily extendable. Within limbs, you create sections of your application. such as limbs/message_board. Limby will look at each limb, and load it's structure. models, controllers, views, app.js, migrations are the main components of a limb.

I said views can be overriden or extended. The core/views folder will overwrite anything in node_modules/limby/views. views/widgets ( in core or a limb ) are used to extend certain views that call renderWidgets, such as the navbar, base/index, home/index, and account/index views. renderWidgets on home/index will look for views/widgets/home/index, making it easy to extend the navbar and main sections with your limbs.

So for example, your limb will have a migration add_favorite_food_to_users_table.

To create the migration

cd core/limbs/myLimb && limby g migration add_favorite_food_to_users_table

Edit the created migration. It has an example in the generated file. See http://knexjs.org/ for how to build schema migrations.

Then, create and edit models/user.js like so:

module.exports = function(limby) {

  // Add attribute to user whitelist    
  limby.models.User.prototype.permittedAttributes.push('favorite_food');
  
}

And in the limb's views/widgets/account/index.ect.html, you can extend fields on the account page so your fb_id

<div>
  <h3> Favorite Food </h3>
  <input name="favorite_food" value="<%- _.escape(@body.favorite_food) || @user.favorite_food %>" />
</div>

You've just extended the main user table with your own field, without editing any base files.

Alphaware -- pre pre release

#Usage

structure

  • index.js
  • config
  • --index.js
  • core
  • --app.js
  • --views
  • --models
  • --migrations
  • --controllers
  • --limbs
  • ----food
  • ------app.js
  • ------views
  • --------index.ect.html
  • ------models
  • --------food.js
  • ------migrations
  • --------2014-04-13T03-27-26-041z__add_foods_table.js // timestamp generated by limby
  • ------controllers
  • --------food.js

main index.js entry point

var
  limby,
  join = require('path').join,
  app   = require('./core/app'),
  Limby = require('limby');

limby = new Limby(join(__dirname, 'config'));

limby.loadNative()
.then(function(){
  return limby.loadLimbs();
})
.then(function(){
  return limby.require('core/app');
})
.then(function(){
  limby.route();
});

core/app.js

module.exports = function(limby) {

var app = limby.app;

// http://domain.com/terms_of_use
app.get('/terms_of_use', ...);

}

limbs/food/controllers/food.js

module.exports = function(limby, models) {

  // models == limby.limbs.food.models
  
  return {
  
    indexRoute: function(req, res, next) {
      // sends limbs/food/views/index
      // res.view adds several attributes to @ context
      res.view('index');
    },
  
  };
};

Requires config/index.js -- customize for your directory structure

module.exports = {

  paths: {
    base:   join(__dirname, '..'),
    core:   join(__dirname, '../core'),
    module: join(__dirname, '../node_modules/limby'),
    views:  join(__dirname, '../core/views'),
    limbs:  join(__dirname, '../core/limbs'),
  },
}

#TODO: Example app

#TODO: Publish facebook auth limb