{"name":"pug-code-gen","version":"3.0.4-canary-8","keywords":["pug"],"author":{"name":"Forbes Lindesay"},"license":"MIT","_id":"pug-code-gen@3.0.4-canary-8","maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"pug-bot","email":"pug-bot@rollingversions.com"}],"homepage":"https://github.com/pugjs/pug/tree/master#readme","bugs":{"url":"https://github.com/pugjs/pug/issues"},"dist":{"shasum":"c8b5ea06eb21c9a2f849445f7e7d080e7836335e","tarball":"http://registry-npm.ywwl.com/pug-code-gen/download/pug-code-gen-3.0.4-canary-8.tgz","fileCount":4,"integrity":"sha512-U4MciF1mOQSTY4R441py0A23aClGpcYmNtp0j2Vo9NWIkdVGQQMAXPn7BzAox9sThT35uJ2WzqmQDXKCC5Wr/Q==","signatures":[{"sig":"MEYCIQCTimjbA7uI6U9ZJlBF26lq9auUhZKr9BMJ1HyN2d8yyAIhAKjCDGrZlVgjiy/76HJC5WRTZNc1VqtamqyX0G9DTfE5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pug-code-gen@3.0.4-canary-8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":29031,"size":8125,"noattachment":false,"key":"/pug-code-gen/-/pug-code-gen-3.0.4-canary-8.tgz"},"gitHead":"c323ed3e630b931bc04790efb509d34ac5927040","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c2e7cfe0-196b-49e5-bc7a-40f7e24a2f11"}},"repository":{"url":"git+https://github.com/pugjs/pug.git#master","type":"git"},"_npmVersion":"11.9.0","description":"Default code-generator for pug.  It generates HTML via a JavaScript template function.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"with":"^7.0.0","doctypes":"^1.1.0","pug-attrs":"3.0.0","pug-error":"2.1.0","pug-runtime":"3.0.1","js-stringify":"^1.0.2","void-elements":"^3.1.0","constantinople":"^4.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/pug-code-gen_3.0.4-canary-8_1773414674937_0.09047580469913163","host":"s3://npm-registry-packages-npm-production"},"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":1773414675077,"_cnpm_publish_time":1773414675077,"dist-tags":{"canary":"3.0.4-canary-8","latest":"3.0.4"}}