{"name":"pug-code-gen","version":"1.1.0","description":"Default code-generator for pug.  It generates HTML via a JavaScript template function.","keywords":["pug"],"dependencies":{"constantinople":"^3.0.1","doctypes":"^1.1.0","js-stringify":"^1.0.1","pug-attrs":"^2.0.1","pug-error":"^1.3.0","pug-runtime":"^2.0.0","void-elements":"^2.0.1","with":"^5.0.0"},"devDependencies":{},"scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git+https://github.com/pugjs/pug-code-gen.git"},"author":{"name":"Forbes Lindesay"},"license":"MIT","gitHead":"16d83f1e0c9fb3b9490c16a53d9ce570a82183dd","bugs":{"url":"https://github.com/pugjs/pug-code-gen/issues"},"homepage":"https://github.com/pugjs/pug-code-gen#readme","_id":"pug-code-gen@1.1.0","_shasum":"f638a6d5792185536a4a2bb3cb73b8f458bdc01f","_from":".","_npmVersion":"3.10.5","_nodeVersion":"6.3.1","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"f638a6d5792185536a4a2bb3cb73b8f458bdc01f","tarball":"http://registry-npm.ywwl.com/pug-code-gen/download/pug-code-gen-1.1.0.tgz","integrity":"sha512-ZaWB48JKghzqKcNf8tqq0Id8TmXe+AznbBMNiEowf2zpSw+QPXUt7ehNb7nYuoUo56ol8EheT20TknnTMxVeNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiRNzLPV2urZkKQYCfkw4yKrMhJx89mVB0xblhIWX7QAIhAKuSgD6FyPYRYl5HyTF5qmTjqlxKy/ukoqGiXJbrDApd"}],"size":7850,"noattachment":false,"key":"/pug-code-gen/-/pug-code-gen-1.1.0.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"timothygu","email":"timothygu99@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pug-code-gen-1.1.0.tgz_1472001035519_0.4586109642405063"},"directories":{},"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":1472001035779,"_cnpm_publish_time":1472001035779,"dist-tags":{"canary":"3.0.4-canary-8","latest":"3.0.4"}}