Coder Social home page Coder Social logo

brick.js's Introduction

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.

brick.js's People

Contributors

harttle avatar

Watchers

James Cloos avatar jeff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.