3.0.5 • Published 7 years ago

brick.js v3.0.5

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

Brick.JS

NPM version Build Status Coverage Status Dependency manager

Scalable Web Development, One Brick at a Time!

Brick.JS is a HMVC style Web Application Framework for Node.js. The entire Web App is break down into a collection of interactive bricks.

  • CommonJS environment for browser-side JavaScript.
  • Template partials are associated with controllers.
  • Automatic CSS modularization.

See Brick.JS Wiki Page for tutorials.

Demo

brick-js/brick-demo is a minimal demo project for Brick.JS

Usage

var express = require('express');
var brickJs = require('brick.js');
var Liquid = require('brick-liquid');

var brk = brickJs({
    root: path.join(__dirname, 'bricks'),
    view: 'view.html',
    router: 'router.js'
});
brk.engine('.html', Liquid());

var app = express();
app.use('/', brk.express);

app.listen(3000, x => console.log('listening to 3000'));

Options

root

Type: String

Default: path.join(__dirname, 'bricks')

Optional. The root directory containing your bricks.

view

Type: String or Array<String>

Default: 'view.html'

Optional. Template file entry(s) of your brick. Can be Array of Strings, eg: ['index.hbs', 'view.html']. Brick.JS will look for corresponding template engine when rendering.

router

Type: String

Default: 'router.js'

Optional. Server-side Router, which exports a ExpressJS compliant url, and REST Routers including get, post, put, delete which accepts 4 arguments: (req, done, fail, res).

Template Engines

Template engines can be registered via .engine(<ext>, <lib>).

Available Template Engines:

Template Engine Development Guide: Template Engine Interface

Static Assets

Static assets for your bricks can be generated by brick-asset.

brick-asset support CSS Pre-Processors like LESS.

Typically, you need brick-asset all before node app.js.

3.0.5

7 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.3.7

8 years ago

2.3.6

8 years ago

2.3.5

8 years ago

2.3.4

8 years ago

2.3.3

8 years ago

2.3.2

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.0.3

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

9 years ago