{"_id":"vhtml","_rev":"9-c7ef09d3f6e3445de1e9725e64ee9b5d","name":"vhtml","description":"Hyperscript reviver that constructs a sanitized HTML string.","dist-tags":{"latest":"2.2.0"},"versions":{"1.0.0":{"name":"vhtml","amdName":"vhtml","version":"1.0.0","description":"Hyperscript reviver that constructs a sanitized HTML string.","main":"dist/vhtml.js","minified:main":"dist/vhtml.min.js","jsnext:main":"src/vhtml.js","scripts":{"build":"npm-run-all transpile minify size","transpile":"rollup -c rollup.config.js","minify":"uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map","size":"echo \"gzip size: $(gzip-size $npm_package_minified_main | pretty-bytes)\"","test":"eslint {src,test} && mocha --compilers js:babel-register test/**/*.js","prepublish":"npm-run-all build test","release":"npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["es2015-minimal","stage-0","react"],"plugins":["transform-object-rest-spread",["transform-react-jsx",{"pragma":"h"}]]},"keywords":["hyperscript","html","renderer","strings"],"repository":{"type":"git","url":"git+https://github.com/developit/vhtml.git"},"author":{"name":"Jason Miller","email":"jason@developit.ca"},"license":"MIT","bugs":{"url":"https://github.com/developit/vhtml/issues"},"homepage":"https://github.com/developit/vhtml","devDependencies":{"babel-core":"^6.6.4","babel-eslint":"^5.0.0","babel-plugin-transform-object-rest-spread":"^6.6.4","babel-plugin-transform-react-jsx":"^6.6.5","babel-preset-es2015-minimal":"^1.1.0","babel-preset-es2015-minimal-rollup":"^1.1.0","babel-preset-react":"^6.5.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.7.2","chai":"^3.5.0","eslint":"~2.2.0","gzip-size-cli":"^1.0.0","mkdirp":"^0.5.1","mocha":"^2.4.5","npm-run-all":"^1.5.1","pretty-bytes-cli":"^1.0.0","rollup":"^0.25.4","rollup-plugin-babel":"^2.4.0","uglify-js":"^2.6.2"},"gitHead":"419824aaaf8191c487679fba651a1c3f7aaf78a8","_id":"vhtml@1.0.0","_shasum":"af09d7bdb487be4480bfa0fa0a97e5a7261a4dd2","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"developit","email":"jason@developit.ca"},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"dist":{"shasum":"af09d7bdb487be4480bfa0fa0a97e5a7261a4dd2","tarball":"https://registry.npmjs.org/vhtml/-/vhtml-1.0.0.tgz","integrity":"sha512-1XOUFlpseGnrm1Y1sRfu1onCBE+Y5ynfYgld1t8KVYuuYrQPdq5SNXcxJMc96K+nwfh75+P9gMOmI8Su+RFitA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE8zYITVl/BzpALonrXHgx/rTNGiF2EKAfTM9VAjhF+DAiA14l7PYCNKD0/YfhlD187xuxomVCVLkv5DU9r/kNjXaQ=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vhtml-1.0.0.tgz_1457832660186_0.46061009098775685"},"directories":{}},"1.1.0":{"name":"vhtml","amdName":"vhtml","version":"1.1.0","description":"Hyperscript reviver that constructs a sanitized HTML string.","main":"dist/vhtml.js","minified:main":"dist/vhtml.min.js","jsnext:main":"src/vhtml.js","scripts":{"build":"npm-run-all transpile minify size","transpile":"rollup -c rollup.config.js","minify":"uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map","size":"echo \"gzip size: $(gzip-size $npm_package_minified_main | pretty-bytes)\"","test":"eslint {src,test} && mocha --compilers js:babel-register test/**/*.js","prepublish":"npm-run-all build test","release":"npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-object-rest-spread",["transform-react-jsx",{"pragma":"h"}]]},"files":["src","dist"],"keywords":["hyperscript","html","renderer","strings"],"repository":{"type":"git","url":"git+https://github.com/developit/vhtml.git"},"author":{"name":"Jason Miller","email":"jason@developit.ca"},"license":"MIT","bugs":{"url":"https://github.com/developit/vhtml/issues"},"homepage":"https://github.com/developit/vhtml","devDependencies":{"babel-core":"^6.6.4","babel-eslint":"^7.0.0","babel-plugin-transform-object-rest-spread":"^6.6.4","babel-plugin-transform-react-jsx":"^6.6.5","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.7.2","chai":"^3.5.0","eslint":"^3.1.0","gzip-size-cli":"^1.0.0","mkdirp":"^0.5.1","mocha":"^3.1.2","npm-run-all":"^2.3.0","pretty-bytes-cli":"^1.0.0","rollup":"^0.36.3","rollup-plugin-babel":"^2.4.0","rollup-plugin-es3":"^1.0.3","uglify-js":"^2.6.2"},"gitHead":"c5a465c220d11ede9878ec27c72641f48886fbb9","_id":"vhtml@1.1.0","_shasum":"b7787d4a0a700974d5630c4c6069a8106d25f910","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"developit","email":"jason@developit.ca"},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"dist":{"shasum":"b7787d4a0a700974d5630c4c6069a8106d25f910","tarball":"https://registry.npmjs.org/vhtml/-/vhtml-1.1.0.tgz","integrity":"sha512-Lzfzco+0pVPWSFg9DbKUxy4mnVxjkfLrMK1fi2yB0ts0vCFFbpn3VsAGkC0948jb0WitlTcj2TwdEbGWJQaB1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdZ2GgLdJdY7hKuMCnH59pBede4H9SAU3KOz2vNL97BAiEAwUad7sK3R+HdLdl+87XM+PsSPz4IYzgU01B05iOKk/M="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vhtml-1.1.0.tgz_1477614746161_0.8790019068401307"},"directories":{}},"2.0.0":{"name":"vhtml","amdName":"vhtml","version":"2.0.0","description":"Hyperscript reviver that constructs a sanitized HTML string.","main":"dist/vhtml.js","minified:main":"dist/vhtml.min.js","jsnext:main":"src/vhtml.js","scripts":{"build":"npm-run-all transpile minify size","transpile":"rollup -c rollup.config.js","minify":"uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map","size":"echo \"gzip size: $(gzip-size $npm_package_minified_main | pretty-bytes)\"","test":"eslint {src,test} && mocha --compilers js:babel-register test/**/*.js","prepublish":"npm-run-all build test","release":"npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-object-rest-spread",["transform-react-jsx",{"pragma":"h"}]]},"files":["src","dist"],"keywords":["hyperscript","html","renderer","strings"],"repository":{"type":"git","url":"git+https://github.com/developit/vhtml.git"},"author":{"name":"Jason Miller","email":"jason@developit.ca"},"license":"MIT","bugs":{"url":"https://github.com/developit/vhtml/issues"},"homepage":"https://github.com/developit/vhtml","devDependencies":{"babel-core":"^6.6.4","babel-eslint":"^7.0.0","babel-plugin-transform-object-rest-spread":"^6.6.4","babel-plugin-transform-react-jsx":"^6.6.5","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.7.2","chai":"^3.5.0","eslint":"^3.1.0","gzip-size-cli":"^1.0.0","mkdirp":"^0.5.1","mocha":"^3.1.2","npm-run-all":"^2.3.0","pretty-bytes-cli":"^1.0.0","rollup":"^0.36.3","rollup-plugin-babel":"^2.4.0","rollup-plugin-es3":"^1.0.3","uglify-js":"^2.6.2"},"gitHead":"cc51b7180c6b2487e8c372496b98f4dc7c45bd03","_id":"vhtml@2.0.0","_shasum":"0e0eddaef716fcc2c32a374f3a0d6b8856d1bf84","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"developit","email":"jason@developit.ca"},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"dist":{"shasum":"0e0eddaef716fcc2c32a374f3a0d6b8856d1bf84","tarball":"https://registry.npmjs.org/vhtml/-/vhtml-2.0.0.tgz","integrity":"sha512-zqIuXnovf+af5zgoI+SGYKEFvMpquWMKfuVdP/tv/bjrYz9ni/tTqpqqxTC9HAGStIRwRwRxY+1YpRfpoonL/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhyGeikTA7h6Y59oTvZfQ+pmT3B8nFHIMRBp3KRTmkgQIgMKdtiirxYrbPlxicyt4zxyDtdlUm/VBvDY2Szgoh5oo="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vhtml-2.0.0.tgz_1478220636388_0.5306355599313974"},"directories":{}},"2.1.0":{"name":"vhtml","amdName":"vhtml","version":"2.1.0","description":"Hyperscript reviver that constructs a sanitized HTML string.","main":"dist/vhtml.js","minified:main":"dist/vhtml.min.js","jsnext:main":"src/vhtml.js","scripts":{"build":"npm-run-all transpile minify size","transpile":"rollup -c rollup.config.js","minify":"uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map","size":"echo \"gzip size: $(gzip-size $npm_package_minified_main | pretty-bytes)\"","test":"eslint {src,test} && mocha --compilers js:babel-register test/**/*.js","prepublish":"npm-run-all build test","release":"npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-object-rest-spread",["transform-react-jsx",{"pragma":"h"}]]},"files":["src","dist"],"keywords":["hyperscript","html","renderer","strings"],"repository":{"type":"git","url":"git+https://github.com/developit/vhtml.git"},"author":{"name":"Jason Miller","email":"jason@developit.ca"},"license":"MIT","bugs":{"url":"https://github.com/developit/vhtml/issues"},"homepage":"https://github.com/developit/vhtml","devDependencies":{"babel-core":"^6.6.4","babel-eslint":"^7.0.0","babel-plugin-transform-object-rest-spread":"^6.6.4","babel-plugin-transform-react-jsx":"^6.6.5","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.7.2","chai":"^3.5.0","eslint":"^3.1.0","gzip-size-cli":"^1.0.0","mkdirp":"^0.5.1","mocha":"^3.1.2","npm-run-all":"^2.3.0","pretty-bytes-cli":"^1.0.0","rollup":"^0.36.3","rollup-plugin-babel":"^2.4.0","rollup-plugin-es3":"^1.0.3","uglify-js":"^2.6.2"},"gitHead":"4b4fd10dd666bf4461838fafcc724bed77e9b536","_id":"vhtml@2.1.0","_shasum":"a858ed2e328c595399a61ae88a0e00fb756be01c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"developit","email":"jason@developit.ca"},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"dist":{"shasum":"a858ed2e328c595399a61ae88a0e00fb756be01c","tarball":"https://registry.npmjs.org/vhtml/-/vhtml-2.1.0.tgz","integrity":"sha512-8lCstCCxwFqS5uEfjlVMxMghdrHwSe0LPTKy1/UGWXOre3sGB5w/1fa4vB8Cxa/atKQVQo9/kO9vEh3TTwsGoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLgWb9DfczUAiz19tA0CJXza9fBr+z6ZTlw1XNS5KR7QIhAMYYO10xnd0vtaaod8z/QUB67+7G56oMOx5bimrzymnc"}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vhtml-2.1.0.tgz_1482110869630_0.4485631932038814"},"directories":{}},"2.2.0":{"name":"vhtml","amdName":"vhtml","version":"2.2.0","description":"Hyperscript reviver that constructs a sanitized HTML string.","main":"dist/vhtml.js","minified:main":"dist/vhtml.min.js","jsnext:main":"src/vhtml.js","scripts":{"build":"npm-run-all transpile minify size","transpile":"rollup -c rollup.config.js","minify":"uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map","size":"echo \"gzip size: $(gzip-size $npm_package_minified_main | pretty-bytes)\"","test":"eslint {src,test} && mocha --compilers js:babel-register test/**/*.js","prepublish":"npm-run-all build test","release":"npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["es2015","stage-0"],"plugins":["transform-object-rest-spread",["transform-react-jsx",{"pragma":"h"}]]},"keywords":["hyperscript","html","renderer","strings"],"repository":{"type":"git","url":"git+https://github.com/developit/vhtml.git"},"author":{"name":"Jason Miller","email":"jason@developit.ca"},"license":"MIT","bugs":{"url":"https://github.com/developit/vhtml/issues"},"homepage":"https://github.com/developit/vhtml","devDependencies":{"babel-core":"^6.6.4","babel-eslint":"^7.0.0","babel-plugin-transform-object-rest-spread":"^6.6.4","babel-plugin-transform-react-jsx":"^6.6.5","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.7.2","chai":"^3.5.0","eslint":"^3.1.0","gzip-size-cli":"^1.0.0","mkdirp":"^0.5.1","mocha":"^3.1.2","npm-run-all":"^2.3.0","pretty-bytes-cli":"^1.0.0","rollup":"^0.36.3","rollup-plugin-babel":"^2.4.0","rollup-plugin-es3":"^1.0.3","uglify-js":"^2.6.2"},"gitHead":"96fe21e63a983d7a8f52d8c51a0c994490313abc","_id":"vhtml@2.2.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TPXrXrxBOslRUVnlVkiAqhoXneiertIg86bdvzionrUYhEuiROvyPZNiiP6GIIJ2Q7oPNVyEtIx8gMAZZE9lCQ==","shasum":"369e6823ed6c32cbb9f6e33395bae7c65faa014c","tarball":"https://registry.npmjs.org/vhtml/-/vhtml-2.2.0.tgz","fileCount":9,"unpackedSize":16734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5wLnCRA9TVsSAnZWagAAWFMP/AhFMVmmcePPOVCT73oD\nHtJAsboN2fdOaRu+q8n6PKeAHr2WqcrNhp+jh3KRAflqmALFFax4IpBUa840\nP8wvxK52TYpQ0QUg8OBZ93xmwlf3tixOZRa9cNwQGB1rC87gQ2yQKLceywuG\nn53VfSRH58svNK+ysmBpAhINj2lcJgHyJRnc4JBM8ojawAKpBoapLph4N8RM\nLIHtMmXC8arrpjo5CNnhiApzIlOAze6/7x1u2aE/F+/IMBhB5QzKQ55X/hvw\nkOhMzlRtZfipb/pbWDHtbEYtALsP1BCrPjIRyuW8NNwVYTlIP23Mqo+Q3nJ1\n7rC7O4T6WEDHfRJlzYoQr/AyorXaVSkapEkWYv8Vg1u9ltRS5M3D1fUEBrta\nAh1HFD7imqlQ2ukFWpaOwbC5AXWFepgPGvfondZGEMC600mnlifvAxRl2X+p\nENlZo34ZZXNut0YT5IPQGQpE0BcJywFGHUl8OLbIb4sV8SGWkYWIsZ1LVGzD\n/iLv0kvc0QvFCmLClbB5/hXjpsmv/2M5Bai6YL7qDeilFUJxGLiMkvY/P7DE\n6S7Wujzba9YsDxLfrgNDMtJlEt3SCKV9d5TVtLzP0D4DMYJGd5pE0i5wZPOX\nwZ82mokYvKyRHB387sWtA5z/C9FBclTDJ3fP+uV7VRnrGKes4AL8vvQcyW7C\n2Z3A\r\n=5T/G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCslbLhsTwuShVGFIhyuVNqtwNNVWt86CNDI2BFM46kyQIhAKEAI/DStQ01PI9Wt4VU7hfHgHcD5+FvxIdLL0taLqSL"}]},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"_npmUser":{"name":"developit","email":"jason@developit.ca"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vhtml_2.2.0_1575420647143_0.2627732911656335"},"_hasShrinkwrap":false}},"readme":"# vhtml\n\n[![NPM](https://img.shields.io/npm/v/vhtml.svg?style=flat)](https://www.npmjs.org/package/vhtml)\n[![travis-ci](https://travis-ci.org/developit/vhtml.svg?branch=master)](https://travis-ci.org/developit/vhtml)\n\n### **Render JSX/Hyperscript to HTML strings, without VDOM**\n\n> Need to use HTML strings (angular?) but want to use JSX? vhtml's got your back.\n>\n> Building components? do yourself a favor and use [<img title=\"Preact\" alt=\"Preact\" src=\"https://cdn.rawgit.com/developit/b4416d5c92b743dbaec1e68bc4c27cda/raw/8dd78c9d138f13e3fec98cbdd6d1c619cf986ee0/preact-logo-trans.svg\" height=\"24\" align=\"top\">](https://github.com/developit/preact)\n\n[**JSFiddle Demo**](https://jsfiddle.net/developit/9q0vyskg/)\n\n---\n\n\n## Installation\n\nVia npm:\n\n`npm install --save vhtml`\n\n\n---\n\n\n## Usage\n\n```js\n// import the library:\nimport h from 'vhtml';\n\n// tell babel to transpile JSX to h() calls:\n/** @jsx h */\n\n// now render JSX to an HTML string!\nlet items = ['one', 'two', 'three'];\n\ndocument.body.innerHTML = (\n  <div class=\"foo\">\n    <h1>Hi!</h1>\n    <p>Here is a list of {items.length} items:</p>\n    <ul>\n      { items.map( item => (\n        <li>{ item }</li>\n      )) }\n    </ul>\n  </div>\n);\n```\n\n\n### New: \"Sortof\" Components!\n\n`vhtml` intentionally does not transform JSX to a Virtual DOM, instead serializing it directly to HTML.\nHowever, it's still possible to make use of basic Pure Functional Components as a sort of \"template partial\".\n\nWhen `vhtml` is given a Function as the JSX tag name, it will invoke that function and pass it `{ children, ...props }`.\nThis is the same signature as a Pure Functional Component in react/preact, except `children` is an Array of already-serialized HTML strings.\n\nThis actually means it's possible to build compositional template modifiers with these simple Components, or even higher-order components.\n\nHere's a more complex version of the previous example that uses a component to encapsulate iteration items:\n\n```js\nlet items = ['one', 'two'];\n\nconst Item = ({ item, index, children }) => (\n  <li id={index}>\n    <h4>{item}</h4>\n    {children}\n  </li>\n);\n\nconsole.log(\n  <div class=\"foo\">\n    <h1>Hi!</h1>\n    <ul>\n      { items.map( (item, index) => (\n        <Item {...{ item, index }}>\n          This is item {item}!\n        </Item>\n      )) }\n    </ul>\n  </div>\n);\n```\n\nThe above outputs the following HTML:\n\n```html\n<div class=\"foo\">\n  <h1>Hi!</h1>\n  <ul>\n    <li id=\"0\">\n      <h4>one</h4>This is item one!\n    </li>\n    <li id=\"1\">\n      <h4>two</h4>This is item two!\n    </li>\n  </ul>\n</div>\n```\n","maintainers":[{"name":"developit","email":"jason@developit.ca"}],"time":{"modified":"2022-06-28T16:48:22.995Z","created":"2016-03-13T01:31:03.913Z","1.0.0":"2016-03-13T01:31:03.913Z","1.1.0":"2016-10-28T00:32:28.605Z","2.0.0":"2016-11-04T00:50:38.301Z","2.1.0":"2016-12-19T01:27:50.214Z","2.2.0":"2019-12-04T00:50:47.291Z"},"homepage":"https://github.com/developit/vhtml","keywords":["hyperscript","html","renderer","strings"],"repository":{"type":"git","url":"git+https://github.com/developit/vhtml.git"},"author":{"name":"Jason Miller","email":"jason@developit.ca"},"bugs":{"url":"https://github.com/developit/vhtml/issues"},"license":"MIT","readmeFilename":"README.md","users":{"developit":true}}