{"name":"pug-code-gen","version":"2.0.3","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","_id":"pug-code-gen@2.0.3","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-r9sezXdDuZJfW9J91TN/2LFbiqDhmltTFmGpHTsGdrNGp3p4SxAjjXEfnuK2e4ywYsRIVP0NeLbSAMHUcaX1EA==","shasum":"122eb9ada9b5bf601705fe15aaa0a7d26bc134ab","tarball":"http://registry-npm.ywwl.com/pug-code-gen/download/pug-code-gen-2.0.3.tgz","fileCount":5,"unpackedSize":26712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgO+GuCRA9TVsSAnZWagAAUXsQAIZAmVjgdz86huL9uXlj\nTbDHW32VyHAyhxCuQrkHRvty2I3n0sqTCzBsQqO9J7CVAKZ4LuZt5GySlx2a\nJeAacxVXiyPAzfPzd2HqjcyFxsKmniPr3zfMlKzTX6/INup+EjXIuNtno67q\nb7SAoj54c76Qx4qVDZb/NJWrsNJ5DOr4hHyzOE4vvJ6rSKyhx2tL70hh0qQn\nAJu4pRCAX3eeO9q4Yg7PnIZ/e5BIn/NWEyat96+9yug1PZckWwwyoBMwr/0k\nMMS9JJpERAvNuGYcpyMOmxyTEq9wQZbaV78xH6SoYDdr4DGVPtfA5x22WGh2\nAD3V7Ia2e0U+9/jgqVOnr89ehDI82zh6LEe/QpWFygvsg56I2bHxhkLzn1Hz\nG71vAe5PaS4yqTkhataIuK7Ty956oOd8+S67Fkol0XpzbtmGJlWc+olsMLiI\nRYcmRX0YLU1xafZggLbaCaJrlYWYe0Y2l+INFWFrELCNBa2WPfqes7uL+Ok/\ncbDGEE/LKvQ6eJf3mFoCCIk4eFf50jwmQPXmnYC6t6Fc/pKLR4m6kumR5JAH\n91/uhS89aAeH5VkHZD4b5ukjLbdG/sxQfynuD4CnF3oaAkWp4Po5qW9QObof\no/2i+1jWkVtAaFLjnUAjeGYAU+LHwhDLY28RTYxVQdW/eucHOu6lbBZG8IpH\nLodk\r\n=U+os\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPhsV0xwv6wpTbJAOFGJv+izEVUCVpEoE3q9Z55jgILAiA3skIVk1OgOXLl4UY9dO7O3zauukInnrDQBrXmyBOPrQ=="}],"size":7891,"noattachment":false,"key":"/pug-code-gen/-/pug-code-gen-2.0.3.tgz"},"_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"directories":{},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"pug-bot","email":"pug-bot@rollingversions.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pug-code-gen_2.0.3_1614537133710_0.3209229642876641"},"_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":1614537133811,"_cnpm_publish_time":1614537133811,"dist-tags":{"canary":"3.0.4-canary-8","latest":"3.0.4"}}