A lightweight component layout engine for client and server.
npm install fruitmachineA lightweight component layout engine for client and server.
FruitMachine is designed to build rich interactive layouts from modular, reusable components. It's light and unopinionated so that it can be applied to almost any layout problem. FruitMachine is currently powering the FT Web App.
``js
// Define a module
var Apple = fruitmachine.define({
name: 'apple',
template: function(){ return 'hello' }
});
// Create a module
var apple = new Apple();
// Render it
apple.render();
apple.el.outerHTML;
//=>
Installation
`
$ npm install fruitmachine
`or
`
$ bower install fruitmachine
`or
Download the [pre-built version][built] (~2k gzipped).
[built]: http://wzrd.in/standalone/fruitmachine@latest
Examples
Documentation
- Introduction
- Getting started
- Defining modules
- Slots
- View assembly
- Instantiation
- Templates
- Template markup
- Rendering
- DOM injection
- The module element
- Queries
- Helpers
- Removing & destroying
- Extending
- Server-side rendering
- API
- Events
Tests
#### With PhantomJS
`
$ npm install
$ npm test
`#### Without PhantomJS
`
$ node_modules/.bin/buster-static
``...then visit http://localhost:8282/ in browser
- Wilson Page - @wilsonpage
- Wilson Page - @wilsonpage
- Matt Andrews - @matthew-andrews