{"name":"babel-template","version":"6.22.0","description":"Generate an AST from a string template.","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-template"},"main":"lib/index.js","dependencies":{"babylon":"^6.11.0","babel-traverse":"^6.22.0","babel-types":"^6.22.0","babel-runtime":"^6.22.0","lodash":"^4.2.0"},"_id":"babel-template@6.22.0","scripts":{},"_shasum":"403d110905a4626b317a2a1fcb8f3b73204b2edb","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.0","_npmUser":{"name":"hzoo","email":"hi@henryzoo.com"},"dist":{"shasum":"403d110905a4626b317a2a1fcb8f3b73204b2edb","tarball":"http://registry-npm.ywwl.com/babel-template/download/babel-template-6.22.0.tgz","integrity":"sha512-+lkwSis8pjRz86SUYUQqDK+VZv85ogVkcHJIN9cr66WBiF3bNqzoMzcp6muyAlMPYTVLQMFkI1yRuWyXmiFWew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7sC8k5k+RVrkU8JyOaVrXQxYnuq9KqaTThRlxVEfT+gIhAPHnI39xrZhnEuopsrtv87gKfZixS/bmsEZPWkcL8cYq"}],"size":2211,"noattachment":false,"key":"/babel-template/-/babel-template-6.22.0.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-18-east.internal.npmjs.com","tmp":"tmp/babel-template-6.22.0.tgz_1484872468077_0.7541811135597527"},"directories":{},"readme":"# babel-template\n\n> Generate an AST from a string template.\n\nIn computer science, this is known as an implementation of quasiquotes.\n\n## Install\n\n```sh\nnpm install --save-dev babel-template\n```\n\n## Usage\n\n```js\nimport template from \"babel-template\";\nimport generate from \"babel-generator\";\nimport * as t from \"babel-types\";\n\nconst buildRequire = template(`\n  var IMPORT_NAME = require(SOURCE);\n`);\n\nconst ast = buildRequire({\n  IMPORT_NAME: t.identifier(\"myModule\"),\n  SOURCE: t.stringLiteral(\"my-module\")\n});\n\nconsole.log(generate(ast).code);\n```\n\n```js\nconst myModule = require(\"my-module\");\n```\n\n## API\n\n### `template(code, [opts])`\n\n#### code\n\nType: `string`\n\n#### options\n\n`babel-template` accepts all of the options from [babylon], and specifies\nsome defaults of its own:\n\n* `allowReturnOutsideFunction` is set to `true` by default.\n* `allowSuperOutsideMethod` is set to `true` by default.\n\n##### preserveComments\n\nType: `boolean`\nDefault: `false`\n\nSet this to `true` to preserve any comments from the `code` parameter.\n\n#### Return value\n\n`babel-template` returns a `function` which is invoked with an optional object\nof replacements. See the usage section for an example.\n\n[babylon]: https://github.com/babel/babylon#options\n","publish_time":1484872468829,"_cnpm_publish_time":1484872468829,"dist-tags":{"latest":"6.26.0","next":"7.0.0-beta.3"}}