0.0.2 • Published 10 years ago
knockout-arrows v0.0.2
knockout-arrows
Rewrites knockout templates on the server to enable the use of arrow functions.
Installation
npm install knockout-arrowsUsage
Command line
knockout-arrows < index.html > transformed.htmlAPI
var rewrite = require('knockout-arrows'),
template = '<ul data-bind="foreach: items.filter(item => item.done)></ul>'
console.log(rewrite(template))Test
npm testAcknowledgements
Based on Chris Price's blog post at http://blog.scottlogic.com/2014/02/28/arrow-functions-in-knockoutjs.html.
License
MIT