{ "_args": [ [ { "raw": "babel-template@^6.3.0", "scope": null, "escapedName": "babel-template", "name": "babel-template", "rawSpec": "^6.3.0", "spec": ">=6.3.0 <7.0.0", "type": "range" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-plugin-transform-decorators-legacy" ] ], "_from": "babel-template@>=6.3.0 <7.0.0", "_id": "babel-template@6.26.0", "_inCache": true, "_location": "/babel-template", "_nodeVersion": "6.9.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/babel-template-6.26.0.tgz_1502898857848_0.5731625664047897" }, "_npmUser": { "name": "hzoo", "email": "hi@henryzoo.com" }, "_npmVersion": "4.6.1", "_phantomChildren": {}, "_requested": { "raw": "babel-template@^6.3.0", "scope": null, "escapedName": "babel-template", "name": "babel-template", "rawSpec": "^6.3.0", "spec": ">=6.3.0 <7.0.0", "type": "range" }, "_requiredBy": [ "/babel-core", "/babel-helper-function-name", "/babel-helper-remap-async-to-generator", "/babel-helper-replace-supers", "/babel-helpers", "/babel-plugin-transform-class-properties", "/babel-plugin-transform-decorators-legacy", "/babel-plugin-transform-es2015-block-scoping", "/babel-plugin-transform-es2015-classes", "/babel-plugin-transform-es2015-computed-properties", "/babel-plugin-transform-es2015-modules-commonjs", "/babel-plugin-transform-es2015-parameters", "/babel-preset-react-native", "/istanbul-lib-instrument" ], "_resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", "_shasum": "de03e2d16396b069f46dd9fff8521fb1a0e35e02", "_shrinkwrap": null, "_spec": "babel-template@^6.3.0", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-plugin-transform-decorators-legacy", "author": { "name": "Sebastian McKenzie", "email": "sebmck@gmail.com" }, "dependencies": { "babel-runtime": "^6.26.0", "babel-traverse": "^6.26.0", "babel-types": "^6.26.0", "babylon": "^6.18.0", "lodash": "^4.17.4" }, "description": "Generate an AST from a string template.", "devDependencies": {}, "directories": {}, "dist": { "shasum": "de03e2d16396b069f46dd9fff8521fb1a0e35e02", "tarball": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz" }, "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", "maintainers": [ { "name": "thejameskyle", "email": "me@thejameskyle.com" }, { "name": "sebmck", "email": "sebmck@gmail.com" }, { "name": "danez", "email": "daniel@tschinder.de" }, { "name": "hzoo", "email": "hi@henryzoo.com" }, { "name": "loganfsmyth", "email": "loganfsmyth@gmail.com" } ], "name": "babel-template", "optionalDependencies": {}, "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", "readmeFilename": "README.md", "repository": { "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-template" }, "scripts": {}, "version": "6.26.0" }