Linenoise

Linenoise is a small library for creating DOM fragments from a terse syntax
that somewhat resembles CSS selectors( see also 'zen code') fixme: link. The format can be somewhat ugly to look at, hence the name.

Download the code, minified if you like, from fixme url here. Add it to a script tag and you should be set.

The library is probably not super useful on node.js, so it's not in npm. It does however export itself if you load it under node, but it assumes there is a "document" object in the global scope.

Usage

When loaded, the library exports a single function, 'linenoise', in the global scope.

The 'linenoise' function takes a template string, and optionally an object with template values as arguments. It returns a DocumentFragment instance that can be inserted into a document.

Syntax

The syntax is a list of nodes and and inheritance markers. Tag nodes look like CSS selectors: