{"_id":"@asamihsoy/json2html","name":"@asamihsoy/json2html","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@asamihsoy/json2html","version":"0.0.1","description":"json2html converter with pug templates","repository":{"type":"git","url":"git+ssh://git@github.com/yoshimsa-yokoyama/json2html-cli.git"},"main":"json2html.js","bin":{"json2html":"json2html.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["json2html"],"author":{"name":"yoshimsa-yokoyama"},"license":"MIT","dependencies":{"chalk":"^4.1.0","commander":"^9.4.1","deepmerge":"^4.2.2","mkdirp":"^1.0.4","pug":"^3.0.2"},"gitHead":"3457fd5cfe9a2299a5329d44d6f69b72157b92c3","bugs":{"url":"https://github.com/yoshimsa-yokoyama/json2html-cli/issues"},"homepage":"https://github.com/yoshimsa-yokoyama/json2html-cli#readme","_id":"@asamihsoy/json2html@0.0.1","_nodeVersion":"16.15.0","_npmVersion":"8.15.1","dist":{"integrity":"sha512-rqCt/0YbhIgSIuhw7mMof6k/ZFuBgdGSBnuqUq/Wznb2m9YhPaQnsq1wjvj7mx0vt1nVG1pgcAbLXyZW3LU9Aw==","shasum":"cf10856dc5c99afafa5e907f3fea78ef5c3d6462","tarball":"https://registry.npmjs.org/@asamihsoy/json2html/-/json2html-0.0.1.tgz","fileCount":3,"unpackedSize":8172,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHkmMDkK55g7ju/DsFkZh0xLgNdyTFnPT9egPMRpJQaSAiEA1ohF8id9uU6wm3IP4GjBt7dNoGxOhv4kKWUHpdPo2zQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdLAiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMQQ/6AxgFtU5WBKEV0Aziw6mRoQN9FE7wovnJLNm0tvCGfUwLsrLs\r\n7W9+SPq0DXE6jKLqTqowa+kwUl748TutQBNfSHdlqlyOphmw5TohiP4BNmtf\r\nSqhUKrhw2C6uc2aPa9UObfRJydW/V3CkbB67FntIwZaAVPBgsBlfCQ8B325j\r\n9SWibIicuRfYBbzKKf9sXvxHAq1Ew31AV8eQNR3E8eEDT4mSwKzVyk3ybYvg\r\n7MAYskV9MEKn0iO2ACAgDXBvOOccCmV4eEMBAptd7uDiz96orDATR+1MNduv\r\nXRmAnd7PonKk8JnAsC+mmjvGTAOedPvoxS8+zstiSBgN0T6DHMIFinyQBEc9\r\nJD9FSozwdn7cMfehIzU9riOREC//Rf+uMDFsgvUiK4m0FA4GNzDCtn89P7qg\r\nPKeKmGJEmzgO3guvz4Msu3gwXTvmSAd5vl9Jn5JZOyJ5OYH3nGAl6c+ymwdF\r\ne3Yi8SCi4C2/95WEMIXxPwehC/GDx6STGM9PNFDaBQJ/FdhnFMXMIUhmkM7C\r\n6O26zfSx/0UfU/Pd1RPWQgtdRm+6GAPmvI/wQP4gO+lqwTrs/K7jPiEmKUyW\r\nYkbgIkH+xqjfOB/ZswQYZcxeRtX7AgJpnCzKaXid/gEY6PXrk63yO6Lq0BXo\r\nifhdwJC3jBg1vASJ7PEMEUY3N60PDOev3h4=\r\n=y5/X\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"yoshimsa-yokoyama","email":"yoshi1026.work@gmail.com"},"directories":{},"maintainers":[{"name":"yoshimsa-yokoyama","email":"yoshi1026.work@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json2html_0.0.1_1668591650464_0.7307696390573983"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-16T09:40:50.340Z","0.0.1":"2022-11-16T09:40:50.661Z","modified":"2022-11-16T09:40:50.925Z"},"maintainers":[{"name":"yoshimsa-yokoyama","email":"yoshi1026.work@gmail.com"}],"description":"json2html converter with pug templates","homepage":"https://github.com/yoshimsa-yokoyama/json2html-cli#readme","keywords":["json2html"],"repository":{"type":"git","url":"git+ssh://git@github.com/yoshimsa-yokoyama/json2html-cli.git"},"author":{"name":"yoshimsa-yokoyama"},"bugs":{"url":"https://github.com/yoshimsa-yokoyama/json2html-cli/issues"},"license":"MIT","readme":"# @asamihsoy/json2html\n\n## Install and usage\n\n``` bash\nnpm i -D @asamihsoy/json2html\nnpx json2html ./path/to/data/json/ -t ./path/to/_template.pug -o ./path/to/output/directory/\n```\n\n## Options\n\n|flag|required|description                                                                                                                                                            |\n|----|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n|`-o`|◯       |Directory to output completed HTML files. You can set javascript file to customize output location by each HTML files. See \"How to customize output location\" section below.|\n|`-t`|◯       |Template pug file to bind data with.                                                                                                                                   |\n|`-d`|        |Single JSON file or directory contains json files. Parsed objects can be accessed under \"data\" variable.                                                               |\n\n## How to customize output location\n\nBy setting javascript file to `-o` option, you can customize HTML file output location.  \nJavascript file is something like this:\n\n#### outputFunc.js\n``` javascript\nconst fs = require('fs');\nconst mkdirp = require('mkdirp');\n\nconst cb = err => {\n  if (err) console.log(err);\n};\n\n// export function for customize\n// obj ... original data passed via json2html command\n// html ... completed HTML string to save\nmodule.exports = function outputFunc (obj,html) {\n\n  // sample: get pid from original data\n  const id = obj.pid\n\n  // create output directory with id\n  mkdirp.sync(`./path/to/output/directory/${id}/`)\n\n  // write file to the directory\n  fs.writeFileSync(\n    `./path/to/output/directory/${id}/index.html`,\n    html,\n    cb\n  )\n}\n```\n\nthen execute json2html command by setting outputFunc.js to `-o` option :\n\n``` bash\nnpx json2html ./path/to/data/json/ -t ./path/to/_template.pug -o ./path/to/outputFunc.js\n```\n","readmeFilename":"README.md"}