Server framework for modular applications
Last updated 6 years ago by danschumann .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hometree 
SYNC missed versions from official npm registry.


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    

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

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

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

Alphaware -- pre pre release



  • 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

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

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

  return limby.loadLimbs();
  return limby.require('core/app');


module.exports = function(limby) {

var app = limby.app;

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



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

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

Current Tags

  • 0.1.1                                ...           latest (6 years ago)

2 Versions

  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (34)
Dev Dependencies (0)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |