Comparing version 0.1.9 to 0.1.10
{ | ||
"name": "dominic", | ||
"version": "0.1.9", | ||
"description": "Helper to quickly build up simple DOM in simple javascript object format.", | ||
"version": "0.1.10", | ||
"description": "Helper to quickly build up DOM in simple javascript object format.", | ||
"main": "dominic.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -10,2 +10,3 @@ ## Dominic | ||
* Template by function | ||
* Server side render to Html (with helper, see API) | ||
@@ -411,4 +412,17 @@ | ||
* window obj must have: | ||
1. Node class with same behavior of a normal HTML element (`appendChild`, `removeChild`, `etc...`) | ||
2. document with `createElement`, `createTextNode` methods which will create Node or TextNode | ||
- Node class with same behavior of a normal HTML element (`appendChild`, `removeChild`, `etc...`) | ||
- document with `createElement`, `createTextNode` methods which will create Node or TextNode | ||
* Suggestion: `fakecument`: `npm i fakecument` | ||
```javascript | ||
var windowObj = require('fakecument') | ||
CreateElement.setWindow(windowObj) | ||
var root = CreateElement('div', { | ||
className: 'abcd', | ||
children: [ | ||
{ tag: 'div', text: 'hello' } | ||
] | ||
}) | ||
console.log('' + root) | ||
// <div class="abcd"><div>hello</div></div> | ||
``` | ||
@@ -415,0 +429,0 @@ ## Plan |
37778
433