npm.io
0.0.5 • Published 5 years ago

incremental-dom-string

Licence
BSD-3-Clause
Version
0.0.5
Deps
1
Size
21 kB
Vulns
0
Weekly
0

Incremental DOM string

Setup

npm install --save incremental-dom-string

Usage

The string to be rendered is described with the incremental node functions, elementOpen, elementClose and text. For example, the following function:

var IncrementalDOM = require('incremental-dom-string');

const output = IncrementalDOM.renderToString(() => {
  IncrementalDOM.elementOpen('div');
    IncrementalDOM.text('Hello world');
  IncrementalDOM.elementClose('div');
});

console.log(output);

where output would correspond to

<div>Hello world</div>