{"_id":"pubjs","_rev":"23-21406f960d46be06a5e2fd3cd3bda566","name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.1":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.1","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engines":{"node":"0.4 || 0.5"},"scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmJsonOpts":{"file":"/home/max/.npm/pubjs/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"pubjs@0.0.1","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"1001c20b58163b134f5e465c370849ea887f4db9","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.1.tgz","integrity":"sha512-luJwC591NI/w8asG2Rb7JtCNc8AphfpU7jrtKmgTs2d0HKyQ4ruC5C/lB70vIcW34NQCunyzi0+cdnFMb6ZEAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHWr6mPRpNBDH9zBhgdEd2A0TZMF7hLxMr1tRZyGhXsAiA8yKPKqIfJUB6qVY/5VH2DNNW07cRCzwiqEWL2WwagDQ=="}]}},"0.0.2":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.2","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.2","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.5.11-pre","_defaultsLoaded":true,"dist":{"shasum":"274795ed4465f9ec46af7f7e1946ed24b433d362","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.2.tgz","integrity":"sha512-V7NJ6qXM2Z5xZcBZblPh+0rRFAvVBMmEch1NOiBTQYG/0mIXDn5n76szHcEWfjUQsKpqHwpYf4mY12cjNnuaSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzI4eUpTmPf4k4dMw8l/PXFXb4+kDF4WurXL2f5tItqwIgQMCyfPmoYzWJ5mNGgysygc3fgX+DkOgYNYcKGV8/2tk="}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]},"0.0.3":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.3","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.3","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.5.11-pre","_defaultsLoaded":true,"dist":{"shasum":"bb39c05ccfe83115591afb939cd76723bfcaa575","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.3.tgz","integrity":"sha512-lKWJBPNvoMP6rXxTl+vV6gm82Ju/ZtZaizYi8cSJqBMCnfIlD1nxrHbq/AMkDOgNlaR6exow688vK8swVStiNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeamaTGZj37C+TjHj6BOt2qhIp2BaV+5WUMdYMCjsHfAiEA88cvysyCCfjDqqCC8ciR7CnB0V44L6EtBj3lumj6aDk="}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]},"0.0.4":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.4","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.4","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-2","_nodeVersion":"v0.6.3","_defaultsLoaded":true,"dist":{"shasum":"0c2471b848dddbc59a3f5974cdb25854cdce6ebb","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.4.tgz","integrity":"sha512-J1ov2CmiPQs0/6/sA3G8DX9lU1sY8jzYJoN7bBqimd1SsTDdtKdQ/FKAGGYQYeagmL0O6rIzJfZEVcRyapBRaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVExzzxa2pJmne1El8xYcUft8CU4qh2A8pABBqReFW4AiA983j904pnTmZ/IvFzb011O+S8d3riKcKdNVZyhzBhcw=="}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]},"0.0.5":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.5","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.5","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"10a2f247ffa66dfaaf954ef1247292ab5ed94e70","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.5.tgz","integrity":"sha512-YMmCZQ4cepmOju4Aw+ll2i4/fWTeAgzzGSyXTV/KKtI6iKGNG1CDoZLWB8W6tAF4H/5nv1n02XYvzijvupERNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAhqmggfLKmrUO0WE4ijnyvj9Tc0+/+2egk5s8QJOBxpAiAvY4aa0uvv6KA/Hgcc/N2Rfhaut9+iI2wP37wst/fYxA=="}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]},"0.0.6":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.6","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.6","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"5a026d7eb70e921f7934694bb8d240be218c3c16","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.6.tgz","integrity":"sha512-e4BJ7oF91/GV+PxjrzM37+Uw4Q0XfYSeCl7uuJH+YZUgeYnB0lS/uQ02ba6uCiPKgBvKy3LHLVYBK3IqfI8byg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqFIwfp511Oa8A7i/zRNUZTTD8RoaVjNx7FdEBbnTq4AiB5XjRKnWjf5B1VZLO+SKMbuNLqmzLTvWCDDGAmHDc4GQ=="}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]},"0.0.7":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.7","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.7","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"31b0a5bbdb1dcf595521e15eab1d4174de1a838f","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.7.tgz","integrity":"sha512-Osvuo/VmO0oEw5c+Fx6XH6BcP1WiGH2jifKyHrqwJ2ZngyN58UZXp/d/AlcO0kKbk9iTuAh2tjhcblmpqMZ31w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqWGSsfOUf2tDPwnbN+F0+F8nwcc7r9BXFv/vx3O49NwIgCo49htCL2GEEsALcSB3GtXkx4af0e08saUIGkf6hXeM="}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]},"0.0.8":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.8","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.8","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"0ce2332b3acdb1a68980d9a42288a842ad43fe73","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.8.tgz","integrity":"sha512-u45iICv10bffA6El/iRKpegn8gYRh/B4akTy6Lu4wc6ise7JRD8jxFHVMzKOcqHTApmoBfu8X9qxSYxd+DS15w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQuGA1t5zn/WeCGnTG16p9JDjJqoxuwDaCY0gaJaTzRAiEA9Uus26jLRfp1ShOxW6zBUWBRJrV5Kr/9HYcrXBR16QA="}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]},"0.0.9":{"author":{"name":"Max Krohn","email":"max@okcupid.com"},"name":"pubjs","description":"A node.js templating language that handles arbitrary and composable nesting","version":"0.0.9","keywords":["okws","pub"],"preferGlobal":true,"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"bugs":{"email":"max@okcupid.com","url":"http://github.com/maxtaco/pubjs/issues"},"main":"lib/pubjs.js","bin":{"pubjs":"lib/main.js"},"engine":"node >= 0.4","scripts":{},"directories":{"lib":"lib","bin":"./bin"},"homepage":"http://github.com/maxtaco/pubjs","_npmUser":{"name":"maxtaco","email":"max@okcupid.com"},"_id":"pubjs@0.0.9","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"def405b5b78d6cc16ef2708623ed6d9d1723db81","tarball":"https://registry.npmjs.org/pubjs/-/pubjs-0.0.9.tgz","integrity":"sha512-tqKx/eW18Hh+waRMkoyjdG+iN04rOhFy1KhE/0xls9ZNKYC8hf36+sVX2/F1fyZ1fs8OsJkHU34KzM9REWnxHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuN332ZtOYLrkqjAWpkJomZwN0nNL5Qz8LRg4Lz1rLgAIhAIWL/rVkvrF0SFj37JUMkIUM6KE4GV9+4eQDbU/5KwMj"}]},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}]}},"maintainers":[{"name":"maxtaco","email":"max@okcupid.com"}],"time":{"modified":"2022-06-24T23:19:10.199Z","created":"2011-07-07T18:16:18.713Z","0.0.1":"2011-07-07T18:16:18.851Z","0.0.2":"2011-11-07T21:32:05.467Z","0.0.3":"2011-11-07T22:26:31.555Z","0.0.4":"2011-12-02T22:15:09.304Z","0.0.5":"2012-01-20T23:01:44.455Z","0.0.6":"2012-01-30T22:12:28.158Z","0.0.7":"2012-01-30T22:17:07.573Z","0.0.8":"2012-01-31T00:28:06.980Z","0.0.9":"2012-01-31T20:56:21.423Z"},"author":{"name":"Max Krohn","email":"max@okcupid.com"},"repository":{"type":"git","url":"git://github.com/maxtaco/pubjs.git"},"readme":"pubjs\n=====\nYet another *node.js* templating system.\n\nIt differs from all others we've seen because it offer arbitrary nesting\nof code and HTML output.  \n\nTutorial and Code Examples\n-------------------------\n\nBy default, input is in HTML mode, in which all input data is\npassed through as output data, with the exception of expressions\nof the form `%{foo}`, which are first evaluated by JavaScript, and\nthen output:\n\n```html\n<b>Name</b>: %{name}<br/>\n<b>Passion</b>: %{passion}<br/>\n```\n\nHowever you can switch from HTML mode into JavaScript mode, with the\n`{% .. %}` environment.  Inside a JavaScript environment, use normal\nJavaScript, and also the function `print` to output HTML:\n\n```html\n<b>Name</b>: %{name}<br/>\n{% if (pet) { print (\"<b>Pet</b>: \", pet); } \n   else     { print (\"<i>no pets</i>\"); } %}</br>\n<b>Passion</b>: %{passion}<br/>\n```\n\nYou can also switch back to HTML mode from within JavaScript mode, with\nany block of the form `{{..}}`.  An equivalent way to write the above is:\n\n```html\n<b>Name</b>: %{name}<br/>\n{% if (pet) {{<b>Pet</b>: %{pet} }}\n   else     {{<i>No pets!</i>}} %}</br>\n<b>Passion</b>: %{passion}<br/>\n```\n\nAnd as advertised, you are free to go as deeply nested as you please:\n\n```html\n<b>Name</b>: %{name}<br/>\n{% if (pet) {{\n    <b>Pet</b>:\n    {% if (pet.type == \"dog\") {{\n           Goes woof! (and is\n           {% if (pet.sex == \"M\") {{neutered}}\n              else                {{spayed}}\n           %}\n           so doesn't reproduce)\n       }} else if (pet.type == \"cat\") {{\n            Goes meow!\n       }}\n    %}\n}} else {{<i>no pet!</i>}} %}\n```\n\nWe've also taken the liberty of adding a bona fide `foreach` to JavaScript,\nfor simplified iteration:\n\n```html\n<table>\n{% \n   foreach (var row in rows) {{\n       <tr>\n       {% \n           foreach (var col in row) {{\n               <td>%{col}</td>\n           }} \n        %}\n        </tr>\n    }}\n%}\n</table>\n```\n\nUsage\n-----\n\nTo install:\n\n    npm install -g pubjs\n\nTo use in express:\n\n```javascript\n\n// Regigster the handler...\napp.register ('.pjs', require ('pubjs'));\n\n// Then invoke it as needs be...\napp.get('/', function(req, res){\n  res.render('index.pjs', {\n    title: 'Express'\n  });\n});\n```\n   \n\nTODOS\n-----\n* regtest suite\n* documentation (flesh out this file)\n","readmeFilename":"","users":{"peteychuk":true}}