paperclip1217

1.2.17 • Public • Published

Build Status Coverage Status Coverage Status

Visit http://paperclipjs.com for further documentation.

Paperclip is a reactive template engine designed for the DOM. It works by compiling templates to document fragments, then clones them whenever they're needed. The result is blazing-fast rendering with very few moving parts.

Features

  • very fast
  • explicit data-bindings (1-way, 2-way, unbound)
  • small (37kb gzipped)
  • accepts plain old javascript objects
  • works with any framework
  • no browser dependencies

Syntax

template:

<input type="text" value="{{ <~> name }}" />
<show when="{{name}}">
  <h3>Hello {{name}}!</h3>
</show>

controller (with brfs):

var pc   = require("paperclip");
var fs   = require("fs");

var helloTemplate = pc.template(fs.readFileSync(__dirname + "/template.pc", "utf8"));
var helloView     = helloTemplate.view();

document.body.appendChild(helloView.render());

Adapters

Examples

Commands

make test-node    # run unit tests in NodeJS
make test-browser # run unit tests in the browser
make test-cov     # run test coverage tool
make parser       # build the parser
make test-watch   # run the tests and watch them
make browser min  # build for the browser
make lint         # run jshint and jscs

Package Sidebar

Install

npm i paperclip1217

Weekly Downloads

0

Version

1.2.17

License

MIT

Last publish

Collaborators

  • architectd