Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

awdry

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awdry

Auto controller-view rendering

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

Awdry

Automatically find views to render from a controller action. Built on Sodor

npm install awdry

Usage

Given a templater quite like Brio that takes a dotted path to a template and a hash of template variables, attaches a render method to controller action with an appropriate path.

var extend = require('estira').extend;
var Controller = require('awdry');
var brio = require('brio');

var templates = brio((t) => (d) => t, {
	account: {
		index: 'hello world'
	}
});

var Account = extend.call(Controller, 'Account', {
	index: function() {
		return this.render();
	}
});

Account.handle('index', [])({}); //⇒ 'hello world'

Licence

MIT. © 2014 Matt Brennan.

Keywords

view

FAQs

Package last updated on 10 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts