{"name":"pug-code-gen","version":"2.0.2","description":"Default code-generator for pug.  It generates HTML via a JavaScript template function.","keywords":["pug"],"dependencies":{"constantinople":"^3.1.2","doctypes":"^1.1.0","js-stringify":"^1.0.1","pug-attrs":"^2.0.4","pug-error":"^1.3.3","pug-runtime":"^2.0.5","void-elements":"^2.0.1","with":"^5.0.0"},"repository":{"type":"git","url":"https://github.com/pugjs/pug/tree/master/packages/pug-code-gen"},"author":{"name":"Forbes Lindesay"},"license":"MIT","gitHead":"1bdf628a70fda7a0d840c52f3abce54b1c6b0130","_id":"pug-code-gen@2.0.2","_nodeVersion":"11.14.0","_npmVersion":"lerna/3.10.8/node@v11.14.0+x64 (darwin)","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"dist":{"integrity":"sha512-kROFWv/AHx/9CRgoGJeRSm+4mLWchbgpRzTEn8XCiwwOy6Vh0gAClS8Vh5TEJ9DBjaP8wCjS3J6HKsEsYdvaCw==","shasum":"ad0967162aea077dcf787838d94ed14acb0217c2","tarball":"http://registry-npm.ywwl.com/pug-code-gen/download/pug-code-gen-2.0.2.tgz","fileCount":5,"unpackedSize":26612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCLKmCRA9TVsSAnZWagAAm3YP/0yP7nUHk/9QXrk+TjtA\nuy0gaGLbpSl8LeypTyjxpX+ooVFqE2WhnBCZPkwGd0VcRcPYibiTeK1nSyvw\nGfVEZwJJSj55CXVlXMgWAYBUVDWPgB363KJ3t+crzf1Bq68GZeTId1jm+5Lg\nLgPkrBrChE7mNlDb+xBpbYIsQeeA4FKatN+NP2qIcACCs/AapDiu4wIHIdqL\nLKNUxtT/B3/U5zggcIE8bZOWl9g7gk7PO0GY/ATyh6IV0eupcF3PLkEZNHtf\nFgRcILJSR06cMeec0vrsSZY4xjsf8V311owMWpuk5TscU3ER1QNQDgzAAegU\nBoKKXGFKHvVOsJv12Oz1ip49+OCZl5bG70vIWhiqMvSkpBcNDrG29A1+D+8B\nUIJq0lejKo3Dhzfkb/U/OUPZpFWMYlE0iizP7RaH1C7To5+n7yl9gXrwk9ea\n7S/LQzGexEnMGZsrcc/NY9erynPaO/43TkcNAyoqOX0tRXVQrWY9lyhyfEY1\nO//CnChUZI6f/wBcnbysF0wyItIwpQtHDGEgC8PGLjDsuvQQ2KLEeOPxc6fc\nYIgX3DqxBOKIoJQfb0o8cccClX/AP5y5+CJQPMg8yqP3eLCfs8Z1fzbZqXnv\nQ2+49WRUqw4/wPfN8Z0bN9WWU7oxvraIoJNQZeIzcJ8+23rBdTK9WYjldNqM\nWmyG\r\n=r2ka\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDds37+rONdJ9WuLV7uAbieo7PNYaMurkqp4i/X9pSB5QIhALkvC10nM2sTs7sk+0w1UsjtARvQDVFNndh11d5HUGCY"}],"size":7888,"noattachment":false,"key":"/pug-code-gen/-/pug-code-gen-2.0.2.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"timothygu","email":"timothygu99@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pug-code-gen_2.0.2_1560851110135_0.311347143285136"},"_hasShrinkwrap":false,"readme":"# pug-code-gen\n\nDefault code-generator for pug.  It generates HTML via a JavaScript template function.\n\n<!-- [![Build Status](https://img.shields.io/travis/pugjs/pug-code-gen/master.svg)](https://travis-ci.org/pugjs/pug-code-gen) -->\n[![Dependencies Status](https://david-dm.org/pugjs/pug/status.svg?path=packages/pug-code-gen)](https://david-dm.org/pugjs/pug?path=packages/pug-code-gen)\n[![npm version](https://img.shields.io/npm/v/pug-code-gen.svg)](https://www.npmjs.org/package/pug-code-gen)\n\n## Installation\n\n    npm install pug-code-gen\n\n## Usage\n\n```js\nvar generateCode = require('pug-code-gen');\n```\n\n### `generateCode(ast, options)`\n\nGenerate a JavaScript function string for the given AST.\n\n`ast` is a fully expanded AST for Pug, with all inclusion, extends, and filters resolved.\n\n`options` may contain the following properties that have the same meaning as the options with the same names in `pug`:\n\n - pretty (boolean): default is `false`\n - compileDebug (boolean): default is `true`\n - doctype (string): default is `undefined`\n - inlineRuntimeFunctions (boolean): default is `false`\n - globals (array of strings): default is `[]`\n - self (boolean): default is `false`\n\nIn addition to above, `pug-code-gen` has the following unique options:\n\n - includeSources (object): map of filename to source string; used if `compileDebug` is `true`; default is `undefined`\n - templateName (string): the name of the generated function; default is `'template'`\n\n```js\nvar lex = require('pug-lexer');\nvar parse = require('pug-parser');\nvar wrap = require('pug-runtime/wrap');\nvar generateCode = require('pug-code-gen');\n\nvar funcStr = generateCode(parse(lex('p Hello world!')), {\n  compileDebug: false,\n  pretty: true,\n  inlineRuntimeFunctions: false,\n  templateName: 'helloWorld'\n});\n//=> 'function helloWorld(locals) { ... }'\n\nvar func = wrap(funcStr, 'helloWorld');\nfunc();\n//=> '\\n<p>Hello world!</p>'\n```\n\n### `new generateCode.CodeGenerator(ast, options)`\n\nThe constructor for the internal class of the code generator. You shouldn't need to use this for most purposes.\n\n## License\n\n  MIT\n","publish_time":1560851110292,"_cnpm_publish_time":1560851110292,"dist-tags":{"canary":"3.0.4-canary-8","latest":"3.0.4"}}