{"_id":"@typhonjs/babel-parser","_rev":"3-f2570af110cdc09cbbe380cbf9170355","name":"@typhonjs/babel-parser","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"@typhonjs/babel-parser","version":"0.0.1","description":"Provides a front end for loading code for AST generation by Babel parser with TyphonJS plugin support.","homepage":"https://github.com/typhonjs-node-ast/babel-parser","license":"MPL-2.0","author":{"name":"Michael Leahy"},"main":"./dist/BabelParser.js","repository":{"type":"git","url":"git+https://github.com/typhonjs-node-ast/babel-parser.git"},"maintainers":[{"name":"typhonrt","email":"support@typhonjs.io"}],"dependencies":{"babel-runtime":"^6.0.0","@babel/parser":"^7.0.0"},"devDependencies":{"typhonjs-config-eslint":"^0.5.0","typhonjs-npm-build-test":"^0.7.0"},"scripts":{"build":"babel-node ./node_modules/typhonjs-npm-scripts-build-babel/scripts/build.js","eslint":"eslint .","prepublish":"babel-node ./node_modules/typhonjs-npm-scripts-publish/scripts/prepublish.js","test":"babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha.js","test-coverage":"babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha-istanbul.js"},"keywords":["typhonjs","babel","parser","AST"],"directories":{},"bugs":{"url":"https://github.com/typhonjs-node-ast/babel-parser/issues"},"gitHead":"f89d5cba47975f22c2ad22d464f6da2765f6fba5","_id":"@typhonjs/babel-parser@0.0.1","_npmVersion":"6.5.0","_nodeVersion":"6.9.4","_npmUser":{"name":"typhonrt","email":"support@typhonjs.io"},"dist":{"integrity":"sha512-boOoVuHkIw8LgVYwg5ioSmbKO3tIQfsjKSCEpZ7N3mWuC/uuXNqA0Z79/h+tix4G76x9UQhgIv2Ac56tJZOMUw==","shasum":"9832c3eec2c3858f9ca3068471ae5104fa933767","tarball":"https://registry.npmjs.org/@typhonjs/babel-parser/-/babel-parser-0.0.1.tgz","fileCount":8,"unpackedSize":33393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGbHCCRA9TVsSAnZWagAA+q8P/RaqnChwa5MDsgzyAxpn\na1sOsLCXgjc0TDL2AuPGdrIqiZA2kTuyYu3tzCklZ5PmoJvnA42Ys7cVbIQM\n8awwewTooIJnNMO9Jv0dhcgzg4KcijaSELySmVbUAPtABIencOfXcjGYEbyE\nSfWgIfL9p58Nmvx/TLZxddaHTbYw1lI7CDvG/mAGrFgXdEi1Rm8O7+bd3+ZO\n+OcuUmZLYgnUs/I3NyE3XV2PdY6T09obaLMvJH2XyFr1scHyFU8tZUibz96W\nCqZB/sFR3ZbuDBSZTUIZ90sh8lb7DL3n160iebf4nFGkTnH3GWR2E7QDGeHr\nxmXgUdYKrb/SjBv6M5rlIa81jrsQg1emfyigv6kqsOlBwpfoOZzBDzjeX3PV\nLrJvOY45RNApY/idFzrw+9GYw6tejI/bauWkPJMcJtCh4HiCC5OAzMRV+63c\n7BXP87oJfcBr5agr+w7sd8RWgKOqNJ8/6bq+QBQHm20sgtZ5AJgPJP1D+STl\ndyQPHeU0smfGRMUvJWMXUGnahV7qSgIspjNKvMpyf+BgyHHQg009RkA7cR21\namcnrMaa7APSDWVU6QCipKBaNBrvgrVoD+3mBbw2kXI72HUPIwnpCAVWWApn\n4mkzlzI6XjJLtxhzVT7CK0qUZvcpNiPDxD82Fau64ziagvn1Ui2oYxBOyn1k\nZO8k\r\n=uIO6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBy56LFnfQgZD7xfr5oHyhm7/ztmirax2vrR0fQ6Cn3bAiEA8yhlzZsgtbjY7ohoFv3kqnpYWKXeDKBcchi0vuPDtxg="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-parser_0.0.1_1545187777738_0.5624202877805662"},"_hasShrinkwrap":false},"0.1.0":{"name":"@typhonjs/babel-parser","version":"0.1.0","description":"Provides a front end for loading code for Javascript / Typescript AST generation by Babel parser with TyphonJS plugin support.","homepage":"https://github.com/typhonjs-node-ast/babel-parser","license":"MPL-2.0","author":{"name":"Michael Leahy"},"main":"./dist/BabelParser.js","repository":{"type":"git","url":"git+https://github.com/typhonjs-node-ast/babel-parser.git"},"maintainers":[{"name":"typhonrt","email":"support@typhonjs.io"}],"dependencies":{"babel-runtime":"^6.0.0","@babel/parser":"^7.0.0"},"devDependencies":{"typhonjs-config-eslint":"^0.5.0","typhonjs-npm-build-test":"^0.7.0"},"scripts":{"build":"babel-node ./node_modules/typhonjs-npm-scripts-build-babel/scripts/build.js","eslint":"eslint .","prepublish":"babel-node ./node_modules/typhonjs-npm-scripts-publish/scripts/prepublish.js","test":"babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha.js","test-coverage":"babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha-istanbul.js"},"keywords":["typhonjs","babel","parser","AST"],"directories":{},"bugs":{"url":"https://github.com/typhonjs-node-ast/babel-parser/issues"},"gitHead":"5b87f050a76cb889373d40ecff0bac445e7a99f6","_id":"@typhonjs/babel-parser@0.1.0","_npmVersion":"6.5.0","_nodeVersion":"6.9.4","_npmUser":{"name":"typhonrt","email":"support@typhonjs.io"},"dist":{"integrity":"sha512-IA0b6s/Tiven7tMWYPOAYzVOnwMQRLd7meZlia1KY8/U1C4VB5VrqkfjJuCJpSIem7q7YOETRDO53BLC74+nFQ==","shasum":"250e23132222eb9f4d96bd6799b84a1cea1f67f9","tarball":"https://registry.npmjs.org/@typhonjs/babel-parser/-/babel-parser-0.1.0.tgz","fileCount":8,"unpackedSize":37076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGcnGCRA9TVsSAnZWagAA3dIP/RHDwyGaP7wZZK/b/PQC\nX48wC35SCLzr0Oml8CoZHCsJm0jF3Z6b7Zp5SsZ2Xxsz68v0CTfgggZCK7uk\nvBQqX01L5kalSY5jt4CJlJhuppG1c3usUyxB1+kKeCR5eg5VIv6e2dA/uMEW\nf2SltrpzmyF+LphB/x5F6LEyGzXcVObyTlpyKSYaNqMY5iydWbHbDAmdZ9oT\nelwr6jMr3QlBEQJjutY+NgCp5cKDY/8UjW37wLILebF7lZ1OISyEzALkyH4i\nArI2oHghUKqVAGkE78eL59ns/QTmRaOCcAcpcHDSNFksKNcadL+8AUJoPthC\nyZlZLd4zW4QkTbd9stqW+InfEig8oKWQqWnGI+KIo4LkYPxW746V7LUtw2A2\nZM1QhBeMpkR91fz9KF+/u8pkHwPVpMU7plrgrDsOMuvrsKUIstxpr0Bcn4RS\nxOj7PVpMD1NV8Oveo9G8XxEeCWMqSgqO0NeFD1xEEtaRQ0xaqqkPryjPro2S\nCW9tOLJKh7gXyANLi+rhd83kvC0nn/LHUF5KJw89YYAZRlgXOViyDq33Mf2B\nfxTU1ThInDmGuR4Bjd1FqHi4aekxLyzDXs4N2FZC5mMVemRPA6ng2JsOX57R\ncyAmuu2U3yoWJ3nV784Ff1ckyONtHFaESD9C6DQ+m/4aQHIBU+FpXayv4yWk\nKeCn\r\n=/Yu0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGyfaVM3+zwp1u1tWezJH2ec4yLxVacisL9cDOZBx4IHAiAzSXjwNlU3v5FL7e4VegqRzAB85NPtXhcZN/8Lge+Pow=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-parser_0.1.0_1545193924777_0.28420469832777484"},"_hasShrinkwrap":false},"0.2.0":{"name":"@typhonjs/babel-parser","version":"0.2.0","description":"Provides a front end for Javascript / Typescript AST generation by Babel parser with TyphonJS plugin support.","homepage":"https://github.com/typhonjs-node-ast/babel-parser","license":"MPL-2.0","author":{"name":"Michael Leahy"},"main":"./dist/BabelParser.js","repository":{"type":"git","url":"git+https://github.com/typhonjs-node-ast/babel-parser.git"},"maintainers":[{"name":"typhonrt","email":"support@typhonjs.io"}],"dependencies":{"babel-runtime":"^6.0.0","@babel/parser":"^7.0.0"},"devDependencies":{"typhonjs-config-eslint":"^0.5.0","typhonjs-npm-build-test":"^0.7.0"},"scripts":{"build":"babel-node ./node_modules/typhonjs-npm-scripts-build-babel/scripts/build.js","eslint":"eslint .","prepublish":"babel-node ./node_modules/typhonjs-npm-scripts-publish/scripts/prepublish.js","test":"babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha.js","test-coverage":"babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha-istanbul.js"},"keywords":["typhonjs","babel","parser","AST"],"directories":{},"bugs":{"url":"https://github.com/typhonjs-node-ast/babel-parser/issues"},"gitHead":"778de654ac76a2cab83b82790246440c017155d6","_id":"@typhonjs/babel-parser@0.2.0","_npmVersion":"6.5.0","_nodeVersion":"6.9.4","_npmUser":{"name":"typhonrt","email":"support@typhonjs.io"},"dist":{"integrity":"sha512-YKqLZaQAVtOjMiqcJIqex1ezduMefBitoQZjsOqr4US+Yq+cOY/obyloOJ7Ee+XDPaaraVrxWkA3VZjOohtVjQ==","shasum":"30a9bdbb843dd645188fae6a816db2ba2dcb5305","tarball":"https://registry.npmjs.org/@typhonjs/babel-parser/-/babel-parser-0.2.0.tgz","fileCount":8,"unpackedSize":37678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGfdDCRA9TVsSAnZWagAAlcwQAJXZr3zKhqjKZsc9FRLA\nmzvx+rgUp8EbXVTCouE6qv3xwAenGWLBoeFEQP5ovAPXyQ6x+u5fe26mMOZK\nWecYRwkFx52dDH9BzcTlebGpO81NrcB8tAhCTzBTAGUBzfenSp/8Prqu9V6x\n6PTPmc9H7CuuxwUGrEciIZkywxbuvjTcKFTCka/OLvh5Y9S4PL8wwLkOmJm8\np6HMlNfaf/Lf1VRI7q9b/nCs7sbRta/aKduxXE3rST7FejLU1oy1+PFsAAKU\nK4NvtkPnN6U+bu/FWAGRRxR6hGtB2iM81NW6bQGRV+g8ReE+VXX3/afTNLTg\nobL7pkxwrq2Z8BDMuyFJZpqZRdbrrDhk5J3tYlZ913ZPlen5NJ4IdoCYO07P\npDj7GwWu+o9Wt29g7T/j0c5C6B6WO2N09Q6kPs2hOshiHIzM7XOpq/sk04FQ\nzdFXaD5LuCCVOpf2arAUIdvLi4FNUBjEuqHqAFTRYVHWpClbovlhw8GlDanF\nwDgoOd9OQOXpA2hdRciU+lKW2SaDM14YK6Pl1TXxkhu/UXjqsamJ6OLbt4Ng\nvUSFQiP2J3K8tn9BT2fO7nHm7o7aqkagGwA336bTW2cQocEfkeRLHdCklErF\nK9oIWxobeY7hEwWsM+gFawjCSTdNkDTEDiNRGY4TA19H9LqRZse+RTrsx84E\nbrWR\r\n=OhAe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAqIn8l4XILd0tkpwEzmEBWxttu+v0Zeyl5u4zRJowMNAiEAiXOx6VXwAkl1mByUkHcfVNYJhHy8/cFezVZMlIH5koI="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-parser_0.2.0_1545205571094_0.20175430177373221"},"_hasShrinkwrap":false}},"time":{"created":"2018-12-19T02:49:37.620Z","0.0.1":"2018-12-19T02:49:37.929Z","modified":"2022-04-07T09:00:49.374Z","0.1.0":"2018-12-19T04:32:04.944Z","0.2.0":"2018-12-19T07:46:11.260Z"},"maintainers":[{"name":"typhonrt","email":"support@typhonjs.io"}],"description":"Provides a front end for Javascript / Typescript AST generation by Babel parser with TyphonJS plugin support.","homepage":"https://github.com/typhonjs-node-ast/babel-parser","keywords":["typhonjs","babel","parser","AST"],"repository":{"type":"git","url":"git+https://github.com/typhonjs-node-ast/babel-parser.git"},"author":{"name":"Michael Leahy"},"bugs":{"url":"https://github.com/typhonjs-node-ast/babel-parser/issues"},"license":"MPL-2.0","readme":"![@typhonjs/babel-parser](https://i.imgur.com/hN409kK.png)\n\n[![NPM](https://img.shields.io/npm/v/@typhonjs/babel-parser.svg?label=npm)](https://www.npmjs.com/package/@typhonjs/babel-parser)\n[![Code Style](https://img.shields.io/badge/code%20style-allman-yellowgreen.svg?style=flat)](https://en.wikipedia.org/wiki/Indent_style#Allman_style)\n[![License](https://img.shields.io/badge/license-MPLv2-yellowgreen.svg?style=flat)](https://github.com/typhonjs-node-ast/babel-parser/blob/master/LICENSE)\n[![Gitter](https://img.shields.io/gitter/room/typhonjs/TyphonJS.svg)](https://gitter.im/typhonjs/TyphonJS)\n\n[![Build Status](https://travis-ci.org/typhonjs-node-ast/babel-parser.svg?branch=master)](https://travis-ci.org/typhonjs-node-ast/babel-parser)\n[![Coverage](https://img.shields.io/codecov/c/github/typhonjs-node-ast/babel-parser.svg)](https://codecov.io/github/typhonjs-node-ast/babel-parser)\n[![Dependency Status](https://david-dm.org/typhonjs-node-ast/babel-parser/status.svg)](https://david-dm.org/typhonjs-node-ast/babel-parser)\n\nProvides a front end for Javascript / Typescript AST generation by Babel parser with TyphonJS plugin support. By default all Babel parser plugins are enabled except for `flow` and there is a handy override mechanism to change relevant defaults without having to provide a full set of options to the parser. \n\nThis NPM module can be installed as a dependency in `package.json` as follows:\n```js\n\"dependencies\": {\n  \"@typhonjs/babel-parser\": \"^0.2.0\"\n}\n```\n\nPlease see [Babel Parser Docs](https://babeljs.io/docs/en/babel-parser) for specific plugin information. By default `babel-parser` enables all plugins except for `flow` as it is incompatible with the `typescript` plugin. Also by default the `decorators` plugins is enabled and not compatible with `decorators-legacy`. \n\nThe default Babel parser options is as follows:\n```\nconst s_DEFAULT_BABELPARSER_OPTIONS =\n{\n   plugins: ['asyncGenerators', 'bigInt', 'classProperties', 'classPrivateProperties', 'classPrivateMethods',\n    ['decorators', { decoratorsBeforeExport: false }], 'doExpressions', 'dynamicImport',\n     'exportDefaultFrom', 'exportNamespaceFrom',  'functionBind', 'functionSent', 'importMeta',\n      'jsx', 'logicalAssignment', 'nullishCoalescingOperator', 'numericSeparator', 'objectRestSpread',\n       'optionalCatchBinding', 'optionalChaining', ['pipelineOperator', { proposal: 'minimal' }], 'throwExpressions',\n        'typescript']\n};\n```\n\nThere is a way to provide additional override directives to `babel-parser` which modifies the default babel parser options above. This only activates when no manual parser options are provided. A third parameter can be passed into `parse` which will modify the default parameters above. For example Flow is supported by passing in `{ flow: true }` as the override object. This allows flow to be enabled and typescript to be disabled without providing the full babel parser options manually. A few other optional overrides are available:\n\n```\n{\n   decoratorsBeforeExport: <boolean>,   // Sets the associated configuration value\n   decoratorsLegacy: true,              // Removes the proposal decorators plugin for `decorators-legacy`\n   flow: true,                          // Enables flow / disables typescript plugins\n   pipelineOperatorProposal: <string>   // Sets the proposal field of pipelineOperator plugin\n}\n```\n\n\nAn ES6 example follows:\n```js\nimport BabelParser from '@typhonjs/babel-parser';\n\n// Basic usage to parse text / source code with default options.\nconst ast = BabelParser.parse(`<some JS or Typescript source code>`);\n\n// Providing custom options\nconst parserOptions = { plugins: [<any parser options desired to be enabled>] };\nconst ast = BabelParser.parse(`<some JS or Typescript source code>`, parserOptions);\n\n// Basic usage with default options, but with an override to disable Typescript and enable Flow plugins\nconst ast = BabelParser.parse(`<some JS w/ Flow typing>`, void 0, { flow: true });\n```\n\n`@typhonjs/babel-parser` may be loaded as a TyphonJS plugin with [typhonjs-plugin-manager](https://www.npmjs.com/package/typhonjs-plugin-manager) and if an eventbus is associated the following event categories are registered:\n\n`typhonjs:babel:parser:parse` - invokes `BabelParser.parse`\n","readmeFilename":"README.md"}