{"_id":"domjs","_rev":"16-b63dbfa28e188229a9eb22d9dbd25f83","name":"domjs","description":"DOM template engine for client and server","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"domjs","version":"0.1.0","description":"Build dom structure easy way with plain js. Client and server side template engine","keywords":["dom","build","builder","template","html"],"author":{"name":"Mariusz Nowak","email":"medikoo+domjs@medikoo.com","url":"http://www.medikoo.com/"},"main":"lib/domjs","repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"bugs":{"email":"medikoo+domjs@medikoo.com","url":"https://github.com/medikoo/domjs/issues"},"scripts":{"test":"node test/run"},"dependencies":{"es5-ext":"0.2.x"},"devDependencies":{"test":"0.1.x","expresso":"0.7.x","jslint":"0.1.x","jsdom":"0.2.x"},"_id":"domjs@0.1.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"4d0bba3215fc014e92f352a4de2ed74e69bae09b","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.1.0.tgz","integrity":"sha512-wKbn0BirMmyWN2BVcOVG7YOI0z0i8+Q1pLOkBxQNhpvBaxhzpaxenKx0bFEKj8VZnpZYrByK4eA4rlqQp6xmmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOIfxMyVt04275YklhWXn2DexYoAyD8O0njXMKEeQhUwIhAK5nC1ZD1UseTu7ZNujY3Wfmd54FUF3/4CY+2l36VA66"}]}},"0.2.0":{"name":"domjs","version":"0.2.0","description":"Build dom structure easy way with plain js. Client and server side template engine","keywords":["dom","build","builder","template","html"],"author":{"name":"Mariusz Nowak","email":"medikoo+domjs@medikoo.com","url":"http://www.medikoo.com/"},"main":"lib/domjs","repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"bugs":{"email":"medikoo+domjs@medikoo.com","url":"https://github.com/medikoo/domjs/issues"},"scripts":{"test":"node ./node_modules/tad/bin/tad lib","lint":"node ./node_modules/jslint/bin/jslint.js --color --git"},"dependencies":{"es5-ext":"0.7.x"},"devDependencies":{"jsdom":"0.2.x","tad":"0.1.x"},"licence":"MIT","_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"_id":"domjs@0.2.0","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"c42a4c0205bd0e9b7a0a2cef343969ef6d2571ad","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.2.0.tgz","integrity":"sha512-GAd7nAsztqWZ+XB6dc2MMuCTb6JmZ95iGGTYQKQC1+ySGWz5f/0m6ze/xEP7mSiNbKDDoCbDq25y9XG437esQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPQwuEBZThHJTKf77J/djNyA0E7SbpV78ROa2jDsdIIAiB44hmEM+fAphVYlQ6JgLOZ9Dt9Cehkv5tomu3Uk5pZYQ=="}]},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}]},"0.2.1":{"name":"domjs","version":"0.2.1","description":"Build dom structure easy way with plain js. Client and server side template engine","keywords":["dom","build","builder","template","html"],"author":{"name":"Mariusz Nowak","email":"medikoo+domjs@medikoo.com","url":"http://www.medikoo.com/"},"main":"lib/domjs","repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"bugs":{"email":"medikoo+domjs@medikoo.com","url":"https://github.com/medikoo/domjs/issues"},"scripts":{"test":"node ./node_modules/tad/bin/tad lib"},"dependencies":{"es5-ext":"0.8.x"},"devDependencies":{"jsdom":"0.2.x","tad":"0.1.x"},"licence":"MIT","optionalDependencies":{},"engines":{"node":">=0.4"},"_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"_id":"domjs@0.2.1","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.6.19","_defaultsLoaded":true,"dist":{"shasum":"25baf8726e7b3a94b79a434c75e479ff167ce733","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.2.1.tgz","integrity":"sha512-8efE8lRjhvJs/+sICyccvXiVqzUGG4k8MAd49U9tSOwvYqyX+1l5sbtqo0Ll3tPTdhxjTVbw+wCpvBDFehuByA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZ5IuvBz6PNUOTLMO31Pg/5QBdUD4Btqze/wSfMkL3QAiAVXn/xN+Z7mRxVfHOhSNd4F6ATdGQCIoM/9MzoWwb7DQ=="}]},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}]},"0.2.2":{"name":"domjs","version":"0.2.2","description":"Build dom structure easy way with plain js. Client and server side template engine","keywords":["dom","build","builder","template","html"],"author":{"name":"Mariusz Nowak","email":"medikoo+domjs@medikoo.com","url":"http://www.medikoo.com/"},"main":"lib/domjs","repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"bugs":{"email":"medikoo+domjs@medikoo.com","url":"https://github.com/medikoo/domjs/issues"},"scripts":{"test":"node ./node_modules/tad/bin/tad lib"},"dependencies":{"es5-ext":"0.8.x"},"devDependencies":{"jsdom":"0.2.x","tad":"0.1.x"},"licence":"MIT","optionalDependencies":{},"engines":{"node":">=0.4"},"_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"_id":"domjs@0.2.2","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.6.19","_defaultsLoaded":true,"dist":{"shasum":"65987c600dc5b2d17222ecfdedebdbfeecaf8060","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.2.2.tgz","integrity":"sha512-aTd6ls/D14KpC23kEl1HCDlliTNDhBH/NUUOrGLLN+0BGwZ5CYGHqK9bccjIo7wZQUEWkfzGb4WnZ+D4MB2PkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICX8aDvCdoBhIRwq0q3GW1i/r0ozMYfjjh2C5gyFA98XAiEAm7wy5gm+vuJVzEOXHpoKsnKkWk1bSD4687Egp0slhS8="}]},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}]},"0.2.3":{"name":"domjs","version":"0.2.3","description":"Build dom structure easy way with plain js. Client and server side template engine","keywords":["dom","build","builder","template","html"],"author":{"name":"Mariusz Nowak","email":"medikoo+domjs@medikoo.com","url":"http://www.medikoo.com/"},"main":"lib/html5","repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"bugs":{"email":"medikoo+domjs@medikoo.com","url":"https://github.com/medikoo/domjs/issues"},"scripts":{"test":"node ./node_modules/tad/bin/tad lib"},"dependencies":{"es5-ext":"0.8.x"},"devDependencies":{"jsdom":"0.2.x","tad":"0.1.x"},"licence":"MIT","optionalDependencies":{},"engines":{"node":">=0.4"},"_id":"domjs@0.2.3","dist":{"shasum":"c1fb1cd04d48ee67e9bdcea3f10b522da0052622","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.2.3.tgz","integrity":"sha512-5tRgpf3CbR96onyuHm1QmhEE91Ojt5bD4JqdQ1K0on/ooU5P36GBQrFajG1REfIZloCLC4UJs6+EeufIx9niRw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICI4GiZYOdiqdtE+O2vmJmMPGBJePcxtAq9tvdHpT+zuAiEAyfpd2/bgm/qu68LlaE2xP2DfS/t5LlqUzUbpzjIoNHk="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}]},"0.3.0":{"name":"domjs","version":"0.3.0","description":"DOM template engine for client and server","author":{"name":"Mariusz Nowak","email":"medikoo@medikoo.com","url":"http://www.medikoo.com/"},"keywords":["dom","build","builder","template","html"],"repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"dependencies":{"d":"1","dom-ext":"0.0.3","es5-ext":"^0.10.12","es6-iterator":"2","es6-map":"^0.1.4","event-emitter":"^0.3.4","memoizee":"^0.4","observable-value":"0.0.5"},"devDependencies":{"commander":"^2.9","jsdom":"^9.4.1","tad":"^0.2.4","xlint":"^0.2.2","xlint-jslint-medikoo":"^0.1.4"},"scripts":{"lint":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream","lint-console":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch","test":"node ./node_modules/tad/bin/tad"},"license":"MIT","gitHead":"ac9c10834bc794f89246a9ef3e1feb6ed27f6415","bugs":{"url":"https://github.com/medikoo/domjs/issues"},"homepage":"https://github.com/medikoo/domjs#readme","_id":"domjs@0.3.0","_shasum":"1df542c048a171f6f0b0b6167c077e5cd1ad7bb6","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"dist":{"shasum":"1df542c048a171f6f0b0b6167c077e5cd1ad7bb6","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.3.0.tgz","integrity":"sha512-3dv31+WW0+TsDiUE9cBKQcMzXWdgaBiGKizRuaTGl0lH1W7fc0CpNdOX5JKGoJJ56i2DspxLL3CAeKpXjaEmCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxImSc4poVSGhaXVVP/kOTHIUjTDlenNnCxRom2sHpIQIhAM+aV9k/et4BrykwSV4iLf9+QBu2hw6Z0TN0m/NrEq8f"}]},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/domjs-0.3.0.tgz_1467904875840_0.2764793550595641"}},"0.3.1":{"name":"domjs","version":"0.3.1","description":"DOM template engine for client and server","author":{"name":"Mariusz Nowak","email":"medikoo@medikoo.com","url":"http://www.medikoo.com/"},"keywords":["dom","build","builder","template","html"],"repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"dependencies":{"d":"1","dom-ext":"0.1","es5-ext":"^0.10.14","es6-iterator":"^2.0.1","es6-map":"^0.1.5","event-emitter":"^0.3.5","memoizee":"^0.4.4","observable-value":"0.1"},"devDependencies":{"commander":"^2.9","jsdom":"^9.4.1","tad":"^0.2.7","xlint":"^0.2.2","xlint-jslint-medikoo":"^0.1.4"},"scripts":{"lint":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream","lint-console":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch","test":"node ./node_modules/tad/bin/tad"},"license":"MIT","gitHead":"f05c10d939353580e141d99f9d7f5a3ca5210a5d","bugs":{"url":"https://github.com/medikoo/domjs/issues"},"homepage":"https://github.com/medikoo/domjs#readme","_id":"domjs@0.3.1","_shasum":"9988c3c24cb0128689aa56b12ec10df9c277f5af","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.0","_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"dist":{"shasum":"9988c3c24cb0128689aa56b12ec10df9c277f5af","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.3.1.tgz","integrity":"sha512-7V/4jlbVj68vdv63WvGNHuW/1pq7C7fggoR7AvMnX9vcrXStQqomzmCm/7z5gZ7HS0k0YZ929xQ7E4hcQoH6Rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbnc0FiVw10lGhRY86P26jTGvXn9qzhrEaENFfNC37+gIgL18oDfWuPkdZjm+ooMopQBWEG9fuTJwekf/D5Ia6MdY="}]},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/domjs-0.3.1.tgz_1489768228383_0.4933089797850698"}},"0.3.2":{"name":"domjs","version":"0.3.2","description":"DOM template engine for client and server","author":{"name":"Mariusz Nowak","email":"medikoo@medikoo.com","url":"http://www.medikoo.com/"},"keywords":["dom","build","builder","template","html"],"repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"dependencies":{"d":"1","dom-ext":"0.1","es5-ext":"^0.10.14","es6-iterator":"^2.0.1","es6-map":"^0.1.5","event-emitter":"^0.3.5","memoizee":"^0.4.4","observable-value":"0.1"},"devDependencies":{"commander":"^2.9","jsdom":"^9.4.1","tad":"^0.2.7","xlint":"^0.2.2","xlint-jslint-medikoo":"^0.1.4"},"scripts":{"lint":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream","lint-console":"node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch","test":"node ./node_modules/tad/bin/tad"},"license":"MIT","gitHead":"d9e9bf739269f4cc6f41906c34a5e88d6fd02e10","bugs":{"url":"https://github.com/medikoo/domjs/issues"},"homepage":"https://github.com/medikoo/domjs#readme","_id":"domjs@0.3.2","_shasum":"2ca52f4925210c8633a54a69aee9470356cef72f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"dist":{"shasum":"2ca52f4925210c8633a54a69aee9470356cef72f","tarball":"https://registry.npmjs.org/domjs/-/domjs-0.3.2.tgz","integrity":"sha512-4fM37TmO9Z+W0ihZMSDOdAZuFsNI8cWfa2cfefBLQQcwmRPFg22+iod7RUo23EWrsZ04+pwEVfq2YH8pdR6szA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPYv2LKfPcgAMej4d85eeObt2Q8w8FWYxUuhjSrRSlqAIgS9L6eannzt7MDbTtFxcRjs1s03NfgvfhYtXrIyfFO/o="}]},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/domjs-0.3.2.tgz_1491314333004_0.9830562726128846"}}},"maintainers":[{"name":"medikoo","email":"medikoo+npm@medikoo.com"}],"time":{"modified":"2022-06-15T21:43:12.725Z","created":"2011-05-29T10:58:47.023Z","0.1.0":"2011-05-29T10:58:47.745Z","0.2.0":"2012-02-20T13:38:29.746Z","0.2.1":"2012-06-13T14:37:25.979Z","0.2.2":"2012-06-13T14:45:50.515Z","0.2.3":"2013-02-12T17:09:54.590Z","0.3.0":"2016-07-07T15:21:18.286Z","0.3.1":"2017-03-17T16:30:30.406Z","0.3.2":"2017-04-04T13:58:53.603Z"},"author":{"name":"Mariusz Nowak","email":"medikoo@medikoo.com","url":"http://www.medikoo.com/"},"repository":{"type":"git","url":"git://github.com/medikoo/domjs.git"},"readme":"# domjs\n## Client and server side dom template engine\n\nBuild dom structure easy way with plain JavaScript. Can be used on both client\nand server side.\n\n### Installation\n\n\t$ npm install domjs\n\nTo port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)\n\n## Usage\n\nWhat would be the easiest, most intuitive way to build html5 DOM tree with plain\nJavaScript ?\n\n```javascript\nvar mytemplate = function () {\n  header(\n    h1('Heading'),\n    h2('Subheading'));\n\n  nav(\n    ul({ 'class': 'breadcrumbs' },\n      li(a({ href: '/' }, 'Home')),\n      li(a({ href: '/section/'}, 'Section')),\n      li(a('Subject'))));\n\n  article(\n    p('Lorem ipsum...'));\n\n  footer('Footer stuff');\n};\n```\n\nThis is how templates for domjs can be written.\n\nPlain `domjs` usage example:\n\n```javascript\nvar domjs = require('domjs')(document);\n\nvar ns = domjs.ns;\nvar dom = domjs.collect(function () {\n  ns.header(\n    ns.h1('Heading'),\n    ns.h2('Subheading'));\n\n  ns.nav(\n    ns.ul({ 'class': 'breadcrumbs' },\n      ns.li(a({ href: '/' }, 'Home')),\n      ns.li(a({ href: '/section/'}, 'Section')),\n      ns.li(a('Subject'))));\n\n  ns.article(\n    ns.p('Lorem ipsum...'));\n\n  ns.footer('Footer stuff');\n});\n\ndocument.body.appendChild(dom); // Insert generated DOM into document body\n```\n\nTo use domjs functions literally as in first example, you will need to prepare dedicated function wrapper\n(either programmatically or manually) as e.g. following:\n\n```javascript\nvar myTemplate = (function () {}\n  var { article, footer, h1, h2, header, li, nav, p, ul } = ns;\n  return function () {\n    header(\n      h1('Heading'),\n      h2('Subheading'));\n\n    nav(\n      ul({ 'class': 'breadcrumbs' },\n        li(a({ href: '/' }, 'Home')),\n        li(a({ href: '/section/'}, 'Section')),\n        li(a('Subject'))));\n\n    article(\n     p('Lorem ipsum...'));\n\n    footer('Footer stuff');\n  };\n}());\nvar dom = domjs.collect(myTemplate);\n```\n\n### Other notes\n\nYou can create custom elements:\n\n```javascript\nvar myCustomElement = domjs.ns.myCustomElement = domjs.ns.element.bind(domjs, 'my-custom-element');\n```\n\nOptionally you may also provide some custom constructor or methods for that element:\n\n```javascript\n// This has to be defined before any `my-custom-element` is created by domjs\nrequire('domjs/ext')['my-custom-element'] = {\n  _construct: function (/* constuctor args */) {},\n  methodA: function () { ... }\n};\n```\n\nYou can save references to elements and operate on them later:\n\n```javascript\nvar myul = ul(li('one'), li('two'), li('three'));\n\n// ... some code ...\n\n// add extra items to myul\nmyul(li('four'), li('five'));\n\n// append myul into other element\ndiv(myul);\n```\n\nYou can access DOM elements directly, just invoke returned function with no\narguments\n\n```javascript\n(myul() instanceof DOMElement) === true\n```\n\nComment type nodes:\n\n```javascript\ncomment('my comment');\n```\n\nCDATA type nodes\n\n```javascript\ncdata('cdata text');\n```\n\nText nodes in main scope:\n\n```javascript\ntext('my text');\n```\n\nElements with names that are reserved keywords in JavaScript language, like\n'var', should be created with preceding underscore added to its name:\n\n```javascript\n_var('var content');\n```\n\n## Tests [![Build Status](https://secure.travis-ci.org/medikoo/domjs.png?branch=master)](https://secure.travis-ci.org/medikoo/domjs)\n\n\t$ npm test\n","homepage":"https://github.com/medikoo/domjs#readme","keywords":["dom","build","builder","template","html"],"bugs":{"url":"https://github.com/medikoo/domjs/issues"},"license":"MIT","readmeFilename":"README.md"}