{"name":"babel-generator","version":"6.5.2-canary.ab7533ed","description":"Turns an AST into code.","author":{"name":"Sebastian McKenzie","email":"sebmck@gmail.com"},"homepage":"https://babeljs.io/","license":"MIT","repository":{"type":"git","url":"https://github.com/babel/babel/tree/master/packages/babel-generator"},"main":"lib/index.js","files":["lib"],"dependencies":{"babel-messages":"^6.3.18","babel-runtime":"^5.0.0","babel-types":"^6.4.5","detect-indent":"^3.0.1","is-integer":"^1.0.4","lodash":"^3.10.1","repeating":"^1.1.3","source-map":"^0.5.0","trim-right":"^1.0.1"},"devDependencies":{"babel-helper-fixtures":"^6.3.13","babylon":"^6.4.5"},"_id":"babel-generator@6.5.2-canary.ab7533ed","scripts":{},"_shasum":"e7ce3d1c43de5b1a4dd726bb829a4319cfcc8357","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.1.0","_npmUser":{"name":"hzoo","email":"hi@henryzoo.com"},"dist":{"shasum":"e7ce3d1c43de5b1a4dd726bb829a4319cfcc8357","tarball":"http://registry-npm.ywwl.com/babel-generator/download/babel-generator-6.5.2-canary.ab7533ed.tgz","integrity":"sha512-rriqFIYZfktBbfiusaCNnuc9nEzjObuwO9rwp4duFjYRzxbTWK0VL9zyTj0Gmxa1H/xV/8eHF7reEXHZ+oaKog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5keFV6S2leHOoweWEE7uEIsCfwGWyqY4heanwctDHjAIgfrqwoSTsmX4bYR3tbVtc1x2LjB5XHEhjgd3Bxwx6N4g="}],"size":19384,"noattachment":false,"key":"/babel-generator/-/babel-generator-6.5.2-canary.ab7533ed.tgz"},"maintainers":[{"name":"amasad","email":"amjad.masad@gmail.com"},{"name":"hzoo","email":"hi@henryzoo.com"},{"name":"jmm","email":"npm-public@jessemccarthy.net"},{"name":"loganfsmyth","email":"loganfsmyth@gmail.com"},{"name":"sebmck","email":"sebmck@gmail.com"},{"name":"thejameskyle","email":"me@thejameskyle.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/babel-generator-6.5.2-canary.ab7533ed.tgz_1456202899226_0.20402560918591917"},"directories":{},"readme":"# babel-generator\n\n> Turns an AST into code.\n\n## Install\n\n```sh\nnpm install --save-dev babel-generator\n```\n\n## Usage\n\n```js\nimport {parse} from 'babylon';\nimport generate from 'babel-generator';\n\nconst code = 'class Example {}';\nconst ast = parse(code);\n\nconst output = generate(ast, { /* options */ }, code);\n```\n\n## Options\n\nOptions for formatting output:\n\nname                   | type     | default         | description\n-----------------------|----------|-----------------|--------------------------------------------------------------------------\nauxiliaryCommentBefore | string   |                 | Optional string to add as a block comment at the start of the output file\nauxiliaryCommentAfter  | string   |                 | Optional string to add as a block comment at the end of the output file\nshouldPrintComment     | function | `opts.comments` | Function that takes a comment (as a string) and returns `true` if the comment should be included in the output.  By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment contains `@preserve` or `@license`\nretainLines            | boolean  | `false`         | Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces)\nretainFunctionParens   | boolean  | `false`         | Retain parens around function expressions (could be used to change engine parsing behavior)\ncomments               | boolean  | `true`          | Should comments be included in output\ncompact                | boolean or `'auto'` | `opts.minified` | Set to `true` to avoid adding whitespace for formatting\nminified               | boolean  | `false`         | Should the output be minified\nconcise                | boolean  | `false`         | Set to `true` to reduce whitespace (but not as much as `opts.compact`)\nquotes                 | `'single'` or `'double'` | autodetect based on `ast.tokens` | The type of quote to use in the output\nfilename               | string   |                 | Used in warning messages\nflowCommaSeparator     | boolean  | `false`         | Set to `true` to use commas instead of semicolons as Flow property separators\njsonCompatibleStrings  | boolean  | `false`         | Set to true to run `jsesc` with \"json\": true to print \"\\u00A9\" vs. \"©\";\n\nOptions for source maps:\n\nname                   | type     | default         | description\n-----------------------|----------|-----------------|--------------------------------------------------------------------------\nsourceMaps             | boolean  | `false`         | Enable generating source maps\nsourceMapTarget        | string   |                 | The filename of the generated code that the source map will be associated with\nsourceRoot             | string   |                 | A root for all relative URLs in the source map\nsourceFileName         | string   |                 | The filename for the source code (i.e. the code in the `code` argument).  This will only be used if `code` is a string.\n\n## AST from Multiple Sources\n\nIn most cases, Babel does a 1:1 transformation of input-file to output-file.  However,\nyou may be dealing with AST constructed from multiple sources - JS files, templates, etc.\nIf this is the case, and you want the sourcemaps to reflect the correct sources, you'll need\nto pass an object to `generate` as the `code` parameter.  Keys\nshould be the source filenames, and values should be the source content.\n\nHere's an example of what that might look like:\n\n```js\nimport {parse} from 'babylon';\nimport generate from 'babel-generator';\n\nconst a = 'var a = 1;';\nconst b = 'var b = 2;';\nconst astA = parse(a, { sourceFilename: 'a.js' });\nconst astB = parse(b, { sourceFilename: 'b.js' });\nconst ast = {\n  type: 'Program',\n  body: [].concat(astA.program.body, astB.program.body)\n};\n\nconst { code, map } = generate(ast, { sourceMaps: true }, {\n  'a.js': a,\n  'b.js': b\n});\n\n// Sourcemap will point to both a.js and b.js where appropriate.\n```\n","publish_time":1456202902705,"_cnpm_publish_time":1456202902705,"dist-tags":{"latest":"6.26.1","next":"7.0.0-beta.3"}}