{ "_args": [ [ { "raw": "babylon@^6.18.0", "scope": null, "escapedName": "babylon", "name": "babylon", "rawSpec": "^6.18.0", "spec": ">=6.18.0 <7.0.0", "type": "range" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-template" ] ], "_from": "babylon@>=6.18.0 <7.0.0", "_id": "babylon@6.18.0", "_inCache": true, "_location": "/babylon", "_nodeVersion": "8.1.4", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/babylon-6.18.0.tgz_1502826087244_0.3836642249953002" }, "_npmUser": { "name": "hzoo", "email": "hi@henryzoo.com" }, "_npmVersion": "5.3.0", "_phantomChildren": {}, "_requested": { "raw": "babylon@^6.18.0", "scope": null, "escapedName": "babylon", "name": "babylon", "rawSpec": "^6.18.0", "spec": ">=6.18.0 <7.0.0", "type": "range" }, "_requiredBy": [ "/babel-core", "/babel-template", "/babel-traverse", "/istanbul-lib-instrument", "/metro" ], "_resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", "_shasum": "af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3", "_shrinkwrap": null, "_spec": "babylon@^6.18.0", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-template", "author": { "name": "Sebastian McKenzie", "email": "sebmck@gmail.com" }, "ava": { "files": [ "test/*.js" ], "source": [ "src/**/*.js", "bin/**/*.js" ] }, "bin": { "babylon": "./bin/babylon.js" }, "bugs": { "url": "https://github.com/babel/babylon/issues" }, "contributors": [ { "name": "List of Acorn contributors. Updated before every release." }, { "name": "Adrian Rakovsky" }, { "name": "Alistair Braidwood" }, { "name": "Andres Suarez" }, { "name": "Aparajita Fishman" }, { "name": "Arian Stolwijk" }, { "name": "Artem Govorov" }, { "name": "Brandon Mills" }, { "name": "Charles Hughes" }, { "name": "Conrad Irwin" }, { "name": "David Bonnet" }, { "name": "Forbes Lindesay" }, { "name": "Gilad Peleg" }, { "name": "impinball" }, { "name": "Ingvar Stepanyan" }, { "name": "Jesse McCarthy" }, { "name": "Jiaxing Wang" }, { "name": "Joel Kemp" }, { "name": "Johannes Herr" }, { "name": "Jürg Lehni" }, { "name": "keeyipchan" }, { "name": "Kevin Kwok" }, { "name": "krator" }, { "name": "Marijn Haverbeke" }, { "name": "Martin Carlberg" }, { "name": "Mathias Bynens" }, { "name": "Mathieu 'p01' Henri" }, { "name": "Max Schaefer" }, { "name": "Max Zerzouri" }, { "name": "Mihai Bazon" }, { "name": "Mike Rennie" }, { "name": "Nick Fitzgerald" }, { "name": "Oskar Schöldström" }, { "name": "Paul Harper" }, { "name": "Peter Rust" }, { "name": "PlNG" }, { "name": "r-e-d" }, { "name": "Rich Harris" }, { "name": "Sebastian McKenzie" }, { "name": "zsjforcn" } ], "dependencies": {}, "description": "A JavaScript parser", "devDependencies": { "ava": "^0.17.0", "babel-cli": "^6.14.0", "babel-eslint": "^7.0.0", "babel-helper-fixtures": "^6.9.0", "babel-plugin-external-helpers": "^6.18.0", "babel-plugin-istanbul": "^3.0.0", "babel-plugin-transform-flow-strip-types": "^6.14.0", "babel-preset-es2015": "^6.14.0", "babel-preset-stage-0": "^6.5.0", "chalk": "^1.1.3", "codecov": "^1.0.1", "cross-env": "^2.0.0", "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", "flow-bin": "^0.42.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", "rollup-plugin-babel": "^2.6.1", "rollup-plugin-node-resolve": "^2.0.0", "rollup-watch": "^3.2.2", "unicode-9.0.0": "~0.7.0" }, "directories": {}, "dist": { "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "shasum": "af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3", "tarball": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz" }, "files": [ "bin", "lib" ], "gitHead": "da66d3f65b0d305c0bb042873d57f26f0c0b0538", "greenkeeper": { "ignore": [ "cross-env" ] }, "homepage": "https://babeljs.io/", "keywords": [ "babel", "javascript", "parser", "babylon" ], "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": "babylon", "nyc": { "include": [ "src/**/*.js", "bin/**/*.js" ], "sourceMap": false, "instrument": false }, "optionalDependencies": {}, "readme": "
\n \n
\n\n\n Babylon is a JavaScript parser used in Babel.\n
\n\n\n\n - The latest ECMAScript version enabled by default (ES2017).\n - Comment attachment.\n - Support for JSX and Flow.\n - Support for experimental language proposals (accepting PRs for anything at least [stage-0](https://github.com/tc39/proposals/blob/master/stage-0-proposals.md)).\n\n## Credits\n\nHeavily based on [acorn](https://github.com/marijnh/acorn) and [acorn-jsx](https://github.com/RReverser/acorn-jsx),\nthanks to the awesome work of [@RReverser](https://github.com/RReverser) and [@marijnh](https://github.com/marijnh).\n\nSignificant diversions are expected to occur in the future such as streaming, EBNF definitions, sweet.js integration, interspatial parsing and more.\n\n## API\n\n### `babylon.parse(code, [options])`\n\n### `babylon.parseExpression(code, [options])`\n\n`parse()` parses the provided `code` as an entire ECMAScript program, while\n`parseExpression()` tries to parse a single Expression with performance in\nmind. When in doubt, use `.parse()`.\n\n### Options\n\n- **allowImportExportEverywhere**: By default, `import` and `export`\n declarations can only appear at a program's top level. Setting this\n option to `true` allows them anywhere where a statement is allowed.\n\n- **allowReturnOutsideFunction**: By default, a return statement at\n the top level raises an error. Set this to `true` to accept such\n code.\n\n- **allowSuperOutsideMethod**: TODO\n\n- **sourceType**: Indicate the mode the code should be parsed in. Can be\n either `\"script\"` or `\"module\"`.\n\n- **sourceFilename**: Correlate output AST nodes with their source filename. Useful when generating code and source maps from the ASTs of multiple input files.\n\n- **startLine**: By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful for integration with other source tools.\n\n- **plugins**: Array containing the plugins that you want to enable.\n\n- **strictMode**: TODO\n\n### Output\n\nBabylon generates AST according to [Babel AST format][].\nIt is based on [ESTree spec][] with the following deviations:\n\n> There is now an `estree` plugin which reverts these deviations\n\n- [Literal][] token is replaced with [StringLiteral][], [NumericLiteral][], [BooleanLiteral][], [NullLiteral][], [RegExpLiteral][]\n- [Property][] token is replaced with [ObjectProperty][] and [ObjectMethod][]\n- [MethodDefinition][] is replaced with [ClassMethod][]\n- [Program][] and [BlockStatement][] contain additional `directives` field with [Directive][] and [DirectiveLiteral][]\n- [ClassMethod][], [ObjectProperty][], and [ObjectMethod][] value property's properties in [FunctionExpression][] is coerced/brought into the main method node.\n\nAST for JSX code is based on [Facebook JSX AST][] with the addition of one node type:\n\n- `JSXText`\n\n[Babel AST format]: https://github.com/babel/babylon/blob/master/ast/spec.md\n[ESTree spec]: https://github.com/estree/estree\n\n[Literal]: https://github.com/estree/estree/blob/master/es5.md#literal\n[Property]: https://github.com/estree/estree/blob/master/es5.md#property\n[MethodDefinition]: https://github.com/estree/estree/blob/master/es2015.md#methoddefinition\n\n[StringLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#stringliteral\n[NumericLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#numericliteral\n[BooleanLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#booleanliteral\n[NullLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#nullliteral\n[RegExpLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#regexpliteral\n[ObjectProperty]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectproperty\n[ObjectMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectmethod\n[ClassMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#classmethod\n[Program]: https://github.com/babel/babylon/blob/master/ast/spec.md#programs\n[BlockStatement]: https://github.com/babel/babylon/blob/master/ast/spec.md#blockstatement\n[Directive]: https://github.com/babel/babylon/blob/master/ast/spec.md#directive\n[DirectiveLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#directiveliteral\n[FunctionExpression]: https://github.com/babel/babylon/blob/master/ast/spec.md#functionexpression\n\n[Facebook JSX AST]: https://github.com/facebook/jsx/blob/master/AST.md\n\n### Semver\n\nBabylon follows semver in most situations. The only thing to note is that some spec-compliancy bug fixes may be released under patch versions.\n\nFor example: We push a fix to early error on something like [#107](https://github.com/babel/babylon/pull/107) - multiple default exports per file. That would be considered a bug fix even though it would cause a build to fail.\n\n### Example\n\n```javascript\nrequire(\"babylon\").parse(\"code\", {\n // parse in strict mode and allow module declarations\n sourceType: \"module\",\n\n plugins: [\n // enable jsx and flow syntax\n \"jsx\",\n \"flow\"\n ]\n});\n```\n\n### Plugins\n\n - `estree`\n - `jsx`\n - `flow`\n - `doExpressions`\n - `objectRestSpread`\n - `decorators` (Based on an outdated version of the Decorators proposal. Will be removed in a future version of `Babylon`)\n - `classProperties`\n - `exportExtensions`\n - `asyncGenerators`\n - `functionBind`\n - `functionSent`\n - `dynamicImport`\n - `templateInvalidEscapes`\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/babel/babylon.git" }, "scripts": { "build": "npm run clean && rollup -c", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", "clean": "rimraf lib", "coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json", "flow": "flow", "lint": "eslint src bin", "prepublish": "cross-env BABEL_ENV=production npm run build", "preversion": "npm run test && npm run changelog", "test": "npm run lint && npm run flow && npm run build -- -m && npm run test-only", "test-ci": "nyc npm run test-only", "test-only": "ava", "watch": "npm run clean && rollup -c --watch" }, "version": "6.18.0" }