{"_id":"egg-view","_rev":"1213288","name":"egg-view","description":"Base view plugin for egg","dist-tags":{"latest":"2.1.3","release-1.x":"1.2.0"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"time":{"modified":"2021-10-13T05:46:43.000Z","created":"2017-02-20T14:34:51.537Z","2.1.3":"2020-11-05T08:14:31.181Z","2.1.2":"2019-01-30T10:18:52.887Z","2.1.1":"2018-12-29T09:35:43.102Z","1.2.0":"2018-03-14T09:44:57.466Z","2.1.0":"2018-02-26T08:40:14.745Z","2.0.0":"2017-11-13T01:42:43.969Z","1.1.2":"2017-07-14T07:52:27.503Z","1.1.1":"2017-06-04T15:02:32.964Z","1.1.0":"2017-04-01T11:45:49.132Z","1.0.1":"2017-02-28T12:54:43.326Z","1.0.0":"2017-02-20T14:34:51.537Z"},"users":{},"author":{"name":"popomore","email":"sakura9515@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"versions":{"2.1.3":{"name":"egg-view","version":"2.1.3","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"mz":"^2.7.0"},"devDependencies":{"@types/node":"^10.12.18","autod":"^2.10.1","coffee":"^5.2.0","egg":"^2.14.2","egg-bin":"^4.3.5","egg-ci":"^1.11.0","egg-mock":"^3.13.1","eslint":"^4.10.0","eslint-config-egg":"^5.1.1","mz-modules":"^1.0.0","typescript":"^3.2.2","webstorm-disable-index":"^1.2.0"},"engines":{"node":">=8.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"types":"index.d.ts","ci":{"version":"8, 10, 11"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"06639ec1e4977f4898c88f04d19efe823de20fcd","_id":"egg-view@2.1.3","_nodeVersion":"12.19.0","_npmVersion":"6.14.7","dist":{"shasum":"06833bfd588ce7819c0f976f04c02e506a77dd4d","size":7239,"noattachment":false,"key":"/egg-view/-/egg-view-2.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-2.1.3.tgz"},"_npmUser":{"name":"atian25","email":"atian25@qq.com"},"directories":{},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view_2.1.3_1604564071071_0.44217981159486963"},"_hasShrinkwrap":false,"publish_time":1604564071181,"_cnpm_publish_time":1604564071181},"2.1.2":{"name":"egg-view","version":"2.1.2","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"mz":"^2.7.0"},"devDependencies":{"@types/node":"^10.12.18","autod":"^2.10.1","coffee":"^5.2.0","egg":"^2.14.2","egg-bin":"^4.3.5","egg-ci":"^1.11.0","egg-mock":"^3.13.1","eslint":"^4.10.0","eslint-config-egg":"^5.1.1","mz-modules":"^1.0.0","typescript":"^3.2.2","webstorm-disable-index":"^1.2.0"},"engines":{"node":">=8.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"types":"index.d.ts","ci":{"version":"8, 10, 11"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"656a098d9cdc2dff8aa9ba3f70df37977991c26a","_id":"egg-view@2.1.2","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"144698b23d1b187e1764e5edceae1819810d7a1f","size":6994,"noattachment":false,"key":"/egg-view/-/egg-view-2.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-2.1.2.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view_2.1.2_1548843532768_0.17765494412713934"},"_hasShrinkwrap":false,"publish_time":1548843532887,"_cnpm_publish_time":1548843532887},"2.1.1":{"name":"egg-view","version":"2.1.1","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"mz":"^2.7.0"},"devDependencies":{"autod":"^2.10.1","coffee":"^5.2.0","egg":"^2.14.2","egg-bin":"^4.3.5","egg-ci":"^1.11.0","egg-mock":"^3.13.1","eslint":"^4.10.0","eslint-config-egg":"^5.1.1","mz-modules":"^1.0.0","typescript":"^3.2.2","webstorm-disable-index":"^1.2.0"},"engines":{"node":">=8.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"types":"index.d.ts","ci":{"version":"8, 10, 11"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"3d9d6b092dc1f384455bb591cca75c9c60f69d80","_id":"egg-view@2.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"46684edb5bd6bfa65e3f234617dd8d939bd7fed8","size":6959,"noattachment":false,"key":"/egg-view/-/egg-view-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-2.1.1.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view_2.1.1_1546076142954_0.8209852939512976"},"_hasShrinkwrap":false,"publish_time":1546076143102,"_cnpm_publish_time":1546076143102},"1.2.0":{"name":"egg-view","version":"1.2.0","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"co":"^4.6.0","mz":"^2.6.0"},"devDependencies":{"autod":"^2.8.0","egg":"^1.0.0","egg-bin":"^3.1.0","egg-ci":"^1.6.0","egg-mock":"^3.2.0","eslint":"^3.18.0","eslint-config-egg":"^3.2.0","mz-modules":"^1.0.0","supertest":"^3.0.0","webstorm-disable-index":"^1.1.2"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"files":["app","lib","config"],"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","publishConfig":{"tag":"release-1.x"},"readmeFilename":"README.md","gitHead":"91fbd025fa6dc51d86e0fbedeb8e2e902e18023a","_id":"egg-view@1.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"6c69ef42904318b0880b44bd43e5aa413cbc5e89","size":6436,"noattachment":false,"key":"/egg-view/-/egg-view-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-1.2.0.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view_1.2.0_1521020697389_0.4653744706047769"},"_hasShrinkwrap":false,"publish_time":1521020697466,"_cnpm_publish_time":1521020697466},"2.1.0":{"name":"egg-view","version":"2.1.0","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"mz":"^2.7.0"},"devDependencies":{"autod":"^2.10.1","egg":"next","egg-bin":"^4.3.5","egg-ci":"^1.8.0","egg-mock":"^3.13.1","eslint":"^4.10.0","eslint-config-egg":"^5.1.1","mz-modules":"^1.0.0","webstorm-disable-index":"^1.2.0"},"engines":{"node":">=8.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"files":["app","lib","config"],"ci":{"version":"8, 9"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"4d5bf9b18ea6438510fabb066ead4897d783c2f9","_id":"egg-view@2.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"aa7ca0344213f5d72147d6001bc0503f858b425c","size":6574,"noattachment":false,"key":"/egg-view/-/egg-view-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-2.1.0.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view_2.1.0_1519634414683_0.7400417723230222"},"_hasShrinkwrap":false,"publish_time":1519634414745,"_cnpm_publish_time":1519634414745},"2.0.0":{"name":"egg-view","version":"2.0.0","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"mz":"^2.7.0"},"devDependencies":{"autod":"^2.10.1","egg":"next","egg-bin":"^4.3.5","egg-ci":"^1.8.0","egg-mock":"^3.13.1","eslint":"^4.10.0","eslint-config-egg":"^5.1.1","mz-modules":"^1.0.0","webstorm-disable-index":"^1.2.0"},"engines":{"node":">=8.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"files":["app","lib","config"],"ci":{"version":"8, 9"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"39937df48e9ee4a10c1a5ec019d9295fa42960c9","_id":"egg-view@2.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"a83904074a31fd76afaa0a42453f0778c26b2276","size":6447,"noattachment":false,"key":"/egg-view/-/egg-view-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-2.0.0.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view-2.0.0.tgz_1510537363898_0.6686005257070065"},"directories":{},"publish_time":1510537363969,"_hasShrinkwrap":false,"_cnpm_publish_time":1510537363969},"1.1.2":{"name":"egg-view","version":"1.1.2","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"co":"^4.6.0","mz":"^2.6.0"},"devDependencies":{"autod":"^2.8.0","egg":"^1.0.0","egg-bin":"^3.1.0","egg-ci":"^1.6.0","egg-mock":"^3.2.0","eslint":"^3.18.0","eslint-config-egg":"^3.2.0","mz-modules":"^1.0.0","supertest":"^3.0.0","webstorm-disable-index":"^1.1.2"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"files":["app","lib","config"],"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"fb008fea94b3538a55efda5075dfc42116b0f129","_id":"egg-view@1.1.2","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"8fe735aa520546b920cdc9b382682f63ec21066e","size":6289,"noattachment":false,"key":"/egg-view/-/egg-view-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-1.1.2.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view-1.1.2.tgz_1500018747340_0.3164524829480797"},"directories":{},"publish_time":1500018747503,"_hasShrinkwrap":false,"_cnpm_publish_time":1500018747503},"1.1.1":{"name":"egg-view","version":"1.1.1","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"co":"^4.6.0","mz":"^2.6.0"},"devDependencies":{"autod":"^2.8.0","egg":"^1.0.0","egg-bin":"^3.1.0","egg-ci":"^1.6.0","egg-mock":"^3.2.0","eslint":"^3.18.0","eslint-config-egg":"^3.2.0","mz-modules":"^1.0.0","supertest":"^3.0.0","webstorm-disable-index":"^1.1.2"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"files":["app","lib","config"],"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"c633fbe5cd1bdb7e3577fcf4680922a39b2f0d5a","_id":"egg-view@1.1.1","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"d8533195ac091a00b6a703c541b4b8c7ea9a42c5","size":6211,"noattachment":false,"key":"/egg-view/-/egg-view-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-1.1.1.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-view-1.1.1.tgz_1496588552729_0.4266971393954009"},"directories":{},"publish_time":1496588552964,"_cnpm_publish_time":1496588552964,"_hasShrinkwrap":false},"1.1.0":{"name":"egg-view","version":"1.1.0","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"co":"^4.6.0","mz":"^2.6.0"},"devDependencies":{"autod":"^2.8.0","egg":"^1.0.0","egg-bin":"^3.1.0","egg-ci":"^1.6.0","egg-mock":"^3.2.0","eslint":"^3.18.0","eslint-config-egg":"^3.2.0","mz-modules":"^1.0.0","supertest":"^3.0.0","webstorm-disable-index":"^1.1.2"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles"},"files":["app","lib","config"],"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"f6e65f471234c4028875317fd995e248777e0401","_id":"egg-view@1.1.0","_shasum":"09350169ecdf29085254348850400ce1b9fa5279","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"09350169ecdf29085254348850400ce1b9fa5279","size":6178,"noattachment":false,"key":"/egg-view/-/egg-view-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-1.1.0.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/egg-view-1.1.0.tgz_1491047147248_0.4095231194514781"},"directories":{},"publish_time":1491047149132,"_hasShrinkwrap":false,"_cnpm_publish_time":1491047149132},"1.0.1":{"name":"egg-view","version":"1.0.1","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"co":"^4.6.0","mz":"^2.6.0"},"devDependencies":{"autod":"^2.7.1","egg":"^1.0.0-rc.1","egg-bin":"^2.2.3","egg-ci":"^1.2.0","egg-mock":"^3.0.1","eslint":"^3.16.1","eslint-config-egg":"^3.2.0","mz-modules":"^1.0.0","supertest":"^3.0.0","webstorm-disable-index":"^1.1.2"},"engines":{"node":">=6.0.0"},"scripts":{"test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","autod":"autod"},"files":["config","app","lib"],"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"5304002dea095800b5e030372b4cd1df0776d6be","_id":"egg-view@1.0.1","_shasum":"d82868f5661c8e28c96be18de0defd0668327651","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"d82868f5661c8e28c96be18de0defd0668327651","size":5973,"noattachment":false,"key":"/egg-view/-/egg-view-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-1.0.1.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/egg-view-1.0.1.tgz_1488286483054_0.5610813656821847"},"directories":{},"publish_time":1488286483326,"_cnpm_publish_time":1488286483326,"_hasShrinkwrap":false},"1.0.0":{"name":"egg-view","version":"1.0.0","description":"Base view plugin for egg","eggPlugin":{"name":"view"},"keywords":["egg","eggPlugin","egg-plugin","egg-view","view"],"dependencies":{"co":"^4.6.0","mz":"^2.6.0"},"devDependencies":{"autod":"^2.7.1","egg":"^0.12.0","egg-bin":"^2.2.1","egg-ci":"^1.1.0","egg-mock":"^3.0.0","eslint":"^3.15.0","eslint-config-egg":"^3.2.0","mz-modules":"^1.0.0","supertest":"^3.0.0","webstorm-disable-index":"^1.1.2"},"engines":{"node":">=6.0.0"},"scripts":{"test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"npm run lint && npm run cov","autod":"autod"},"files":["config","app","lib"],"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-view.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-view#readme","author":{"name":"popomore","email":"sakura9515@gmail.com"},"license":"MIT","gitHead":"2f663d39db4b478bb7f8655271732b578d8502cc","_id":"egg-view@1.0.0","_shasum":"e9085bff61914e9272ce30b2882d38e67bec8dd9","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"popomore","email":"sakura9515@gmail.com"},"dist":{"shasum":"e9085bff61914e9272ce30b2882d38e67bec8dd9","size":5858,"noattachment":false,"key":"/egg-view/-/egg-view-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/egg-view/download/egg-view-1.0.0.tgz"},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/egg-view-1.0.0.tgz_1487601291305_0.1758509292267263"},"directories":{},"publish_time":1487601291537,"_cnpm_publish_time":1487601291537,"_hasShrinkwrap":false}},"readme":"# egg-view\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-view.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-view\n[travis-image]: https://img.shields.io/travis/eggjs/egg-view.svg?style=flat-square\n[travis-url]: https://travis-ci.org/eggjs/egg-view\n[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-view.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/eggjs/egg-view?branch=master\n[david-image]: https://img.shields.io/david/eggjs/egg-view.svg?style=flat-square\n[david-url]: https://david-dm.org/eggjs/egg-view\n[snyk-image]: https://snyk.io/test/npm/egg-view/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-view\n[download-image]: https://img.shields.io/npm/dm/egg-view.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-view\n\nBase view plugin for egg\n\n**it's a plugin that has been built-in for egg.**\n\n## Install\n\n```bash\n$ npm i egg-view --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.view = {\n  enable: true,\n  package: 'egg-view',\n};\n```\n\n## Use a template engine\n\n[egg-view] don't have build-in view engine, So you should choose a template engine like [ejs], and install [egg-view-ejs] plugin.\n\nYou can choose a template engine first, link [ejs], so we use [egg-view-ejs] plugin.\n\n`egg-view` is in [eggjs], so you just need configure [egg-view-ejs].\n\n```js\n// config/plugin.js\nexports.ejs = {\n  enable: true,\n  package: 'egg-view-ejs',\n};\n```\n\nConfigure the mapping, the file with `.ejs` extension will be rendered by ejs.\n\n```js\n// config/config.default.js\nexports.view = {\n  mapping: {\n    '.ejs': 'ejs',\n  },\n};\n```\n\nIn controller, you can call `ctx.render`.\n\n```js\nmodule.exports = app => {\n  return class UserController extends app.Controller {\n    async list() {\n      const { ctx } = this;\n      await ctx.render('user.ejs');\n    }\n  };\n};\n```\n\nIf you call `ctx.renderString`, you should specify viewEngine in viewOptions.\n\n```js\nmodule.exports = app => {\n  return class UserController extends app.Controller {\n    async list() {\n      const { ctx } = this;\n      ctx.body = await ctx.renderString('<%= user %>', { user: 'popomore' }, {\n        viewEngine: 'ejs',\n      });\n    }\n  };\n};\n```\n\n## Use multiple view engine\n\n[egg-view] support multiple view engine, so you can use more than one template engine in one application.\n\nIf you want add another template engine like [nunjucks], then you can add [egg-view-nunjucks] plugin.\n\nConfigure the plugin and mapping\n\n```js\n// config/config.default.js\nexports.view = {\n  mapping: {\n    '.ejs': 'ejs',\n    '.nj': 'nunjucks',\n  },\n};\n```\n\nYou can simply render the file with `.nj` extension.\n\n```js\nawait ctx.render('user.nj');\n```\n\n## How to write a view plugin\n\nYou can use [egg-view]' API to register a plugin.\n\n### View engine\n\nCreate a view engine class first, and implement `render` and `renderString`, if the template engine don't support, just throw an error. The view engine is context level, so it receive ctx in `constructor`.\n\n```js\n// lib/view.js\nmodule.exports = class MyView {\n  constructor(ctx) {\n    // do some initialize\n    // get the plugin config from `ctx.app.config`\n  }\n\n  async render(fullpath, locals) {\n    return myengine.render(fullpath, locals);\n  }\n\n  async renderString() { throw new Error('not implement'); }\n};\n```\n\n`render` and `renderString` support generator function, async function, or normal function return a promise.\n\nIf the template engine only support callback, you can wrap it by Promise.\n\n```js\nclass MyView {\n  render(fullpath, locals) {\n    return new Promise((resolve, reject) => {\n      myengine.render(fullpath, locals, (err, result) => {\n        if (err) {\n          reject(err);\n        } else {\n          resolve(result);\n        }\n      });\n    });\n  }\n};\n```\n\nThese methods receive three arguments, `renderString` will pass tpl as the first argument instead of name in `render`.\n\n`render(name, locals, viewOptions)`\n\n- name: the file path that can resolve from root (`app/view` by default)\n- locals: data used by template\n- viewOptions: the view options for each render, it can override the view default config in `config/config.default.js`. Plugin should implement it if it has config.\n  When you implement view engine, you will receive this options from `render`, the options contain:\n  - root: egg-view will resolve the name to full path, but seperating root and name in viewOptions.\n  - name: the original name when call render\n  - locals: the original locals when call render\n\n`renderString(tpl, locals, viewOptions)`\n\n- tpl: the template string instead of the file, using in `renderString`\n- locals: same as `render`\n- viewOptions: same as `render`\n\n### Register\n\nAfter define a view engine, you can register it.\n\n```js\n// app.js\nmodule.exports = app => {\n  app.view.use('myName', require('./lib/view'));\n};\n```\n\nYou can define a view engine name, normally it's a template name.\n\n### Configure\n\nDefine plugin name and depend on [egg-view]\n\n```json\n{\n  \"eggPlugin\": {\n    \"name\": \"myName\",\n    \"dependencies\": [ \"view\" ]\n  }\n}\n```\n\nSet default config in `config/config.default.js`, the name is equals to plugin name.\n\n```js\nexports.myName = {},\n```\n\nSee some examples\n\n- [egg-view-ejs]\n- [egg-view-nunjucks]\n\n## Configuration\n\n### Root\n\nRoot is `${baseDir}/app/view` by default, but you can define multiple directory, seperated by `,`. [egg-view] will find a file from all root directories.\n\n```js\nmodule.exports = appInfo => {\n  const baseDir = appInfo.baseDir;\n  return {\n    view: {\n      root: `${baseDir}/app/view,${baseDir}/app/view2`\n    }\n  }\n}\n```\n\n### defaultExtension\n\nWhen render a file, you should specify a extension that let [egg-view] know whitch engine you want to use. However you can define `defaultExtension` without write the extension.\n\n```js\n// config/config.default.js\nexports.view = {\n  defaultExtension: '.html',\n};\n\n// controller\nmodule.exports = app => {\n  return class UserController extends app.Controller {\n    async list() {\n      const { ctx } = this;\n      // render user.html\n      await ctx.render('user');\n    }\n  };\n};\n```\n\n### viewEngine and defaultViewEngine\n\nIf you are using `renderString`, you should specify viewEngine in view config, see example above.\n\nHowever, you can define `defaultViewEngine` without set each time.\n\n```js\n// config/config.default.js\nexports.view = {\n  defaultViewEngine: 'ejs',\n};\n```\n\nsee [config/config.default.js](https://github.com/eggjs/egg-view/blob/master/config/config.default.js) for more detail.\n\n## Questions & Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](https://github.com/eggjs/egg-view/blob/master/LICENSE)\n\n\n[eggjs]: https://eggjs.org\n[ejs]: https://github.com/mde/ejs\n[egg-view-ejs]: https://github.com/eggjs/egg-view-ejs\n[egg-view]: https://github.com/eggjs/egg-view\n[nunjucks]: http://mozilla.github.io/nunjucks\n[egg-view-nunjucks]: https://github.com/eggjs/egg-view-nunjucks\n","_attachments":{},"homepage":"https://github.com/eggjs/egg-view#readme","bugs":{"url":"https://github.com/eggjs/egg/issues"},"license":"MIT"}