{"nyc":{"exclude":["build/test/**/*.*"],"reporter":["lcov","text"]},"bugs":{"url":"https://github.com/cherow/cherow/issues"},"dist":{"shasum":"4730943332a584d5467664a19feb37814a5a87ad","tarball":"https://registry.npmjs.org/cherow/-/cherow-4.9.2018924.tgz","fileCount":43,"integrity":"sha512-yZ8Br9pt0nYz8z630IYCzDN0eWH5aIpmszEpCIzCaZYsxE02iHaLSSoBvV9xj4rQFy9hEZmXe8cx+V+oQt4YuA==","signatures":[{"sig":"MEUCIQDOEkKM0M2LM6DnM5QSElwkbGAwYm/9h20NdFLbOq5/igIgTlDBatMR6K4t+0VMvUBH9ZKwOrTJj8Y3t99p5uG+ccs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":882456},"main":"lib/cherow.js","name":"cherow","files":["dist","lib","CODE_OF_CONDUCT.md","CONTRIBUTING.md","README.md","LICENSE.md"],"types":"lib/cherow.d.ts","author":{"name":"KFlash"},"readme":"# Cherow\r\n\r\n[![NPM version](https://img.shields.io/npm/v/cherow.svg)](https://www.npmjs.com/package/cherow)\r\n[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/cherow/cherow)\r\n[![Build Status](https://travis-ci.org/cherow/cherow.svg?branch=master)](https://travis-ci.org/cherow/cherow)\r\n[![Build status](https://ci.appveyor.com/api/projects/status/pkydnkv0deckns5l/branch/master?svg=true)](https://ci.appveyor.com/project/Kflash/cherow/branch/master)\r\n[![CircleCI](https://circleci.com/gh/cherow/cherow.svg?style=svg)](https://circleci.com/gh/cherow/cherow)\r\n[![Coverage Status](https://coveralls.io/repos/github/cherow/cherow/badge.svg?branch=master)](https://coveralls.io/github/cherow/cherow?branch=master)\r\n\r\n**In active development!!**\r\n\r\nA very fast and lightweight, standards-compliant, self-hosted javascript parser with high focus on both performance and stability.\r\n\r\n## Features\r\n\r\n* Conforms to the standard ECMAScript® 2018 [(ECMA-262 9th Edition)](https://tc39.github.io/ecma262/) language specification \r\n* Supports Stage 3 proposals via option\r\n* Optionally track syntactic node locations\r\n* Emits an [ESTree-compatible](https://github.com/estree/estree) abstract syntax tree.\r\n* Very well tested (~23 000 [unit tests](https://github.com/cherow/cherow/tree/master/test) with [full code coverage)](https://coveralls.io/github/cherow/cherow))\r\n* Lightweight - 62 KB minified\r\n\r\n## ESNext features\r\n\r\n`Stage 3` features support. These need to be enabled with the `next` option. \r\n\r\n* [Import()](https://github.com/tc39/proposal-dynamic-import)\r\n* [Class field declarations for JavaScript](https://github.com/tc39/proposal-class-fields)\r\n* [Numeric Separators](https://github.com/tc39/proposal-numeric-separator)\r\n* [Private methods and getter/setters for JavaScript classes](https://github.com/tc39/proposal-private-methods)\r\n* [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding)\r\n* [JSON Superset](https://github.com/tc39/proposal-json-superset)\r\n* [BigInt](https://github.com/tc39/proposal-bigint)\r\n* [Import.meta](https://github.com/tc39/proposal-import-meta)\r\n\r\n\r\n## Builds\r\n\r\nCherow contains 3 different builds:\r\n\r\n| Name        | Description |\r\n| ----------- | ------------------------------------------------------------ |\r\n| `Stable`    | Stable release |\r\n| `Next`      | Has the `next` option enabled by default, and support all latest ECMAScript proposals. |\r\n| `Bleeding`  | The active development branch. You can and will expect bugs with this branch because it's not stable |\r\n\r\n## API\r\n\r\nCherow generates AST according to [ESTree AST format](https://github.com/estree/estree), and can be used to perform [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program, and with ES2015 and later a JavaScript program can be either [a script or a module](http://www.ecma-international.org/ecma-262/8.0/index.html#sec-ecmascript-language-scripts-and-modules) and this is achieved by choosing [`parseScript`](http://www.ecma-international.org/ecma-262/8.0/#sec-parse-script) function to parse a script and [`parseModule`](http://www.ecma-international.org/ecma-262/8.0/#sec-parsemodule) function to parse a module.\r\n\r\n\r\nHere is a quick example:\r\n\r\n```js\r\n\r\ncherow.parseScript('const fooBar = 123;', { ranges: true });\r\n\r\n```\r\n\r\nThis will return when serialized in json:\r\n\r\n```js\r\n{\r\n    \"type\": \"Program\",\r\n    \"sourceType\": \"script\",\r\n    \"body\": [\r\n        {\r\n            \"type\": \"VariableDeclaration\",\r\n            \"declarations\": [\r\n                {\r\n                    \"type\": \"VariableDeclarator\",\r\n                    \"init\": {\r\n                        \"type\": \"Literal\",\r\n                        \"value\": 123,\r\n                        \"start\": 15,\r\n                        \"end\": 18\r\n                    },\r\n                    \"id\": {\r\n                        \"type\": \"Identifier\",\r\n                        \"name\": \"fooBar\",\r\n                        \"start\": 6,\r\n                        \"end\": 12\r\n                    },\r\n                    \"start\": 6,\r\n                    \"end\": 18\r\n                }\r\n            ],\r\n            \"kind\": \"const\",\r\n            \"start\": 0,\r\n            \"end\": 19\r\n        }\r\n    ],\r\n    \"start\": 0,\r\n    \"end\": 19\r\n}\r\n```\r\n\r\n## Options\r\n\r\nThere is a second argument to both methods that allows you to specify various options:\r\n\r\n| Option        | Description |\r\n| ----------- | ------------------------------------------------------------ |\r\n| `delegate`        | Accepts a callback function to be invoked for each syntax node (as the node is constructed) |\r\n| `loc      `       | Attach line/column location information to each node |\r\n| `ranges`          | Append start and end offsets to each node |\r\n| `globalReturn`    | Allow return in the global scope |\r\n| `skipShebang`     | Allow to skip shebang - '#' |\r\n| `impliedStrict`   | Enable implied strict mode |\r\n| `next`            | Enable stage 3 support (*ESNext*)  |\r\n| `source`          | Set to true to record the source file in every node's `loc` object when the `loc option` is set.  |\r\n| `raw`             | Attach raw property to each literal node    |\r\n\r\n\r\n# Modules\r\n\r\nIn Cherow this replace the traditional plugin system, and let you import the parser instance and\r\ndevelop your own functions with it, and / or re-use existing one.\r\n\r\nExample:\r\n\r\n```js\r\nimport { parser, scanSignedInteger, parseScript, parserModule } from 'cherow';\r\n\r\nfunction doWhatYouWant(parser, context) {\r\n    // do some magic with numbers\r\n    value = scanSignedInteger(parser, context); / '+', '-'\r\n\r\n    // ...\r\n}\r\n\r\n```\r\n\r\n## Performance \r\n\r\n\r\n#### Benchmark #1\r\n\r\n![Alt text](bench.png?raw=true \"Title\")\r\n\r\n#### Benchmark #2\r\n\r\n**Note!** This Jazzle parser couldn't parse the TypeScript library, so the results is not 100%.\r\n\r\n![Alt text](bench1.png?raw=true \"Title\")\r\n","gitHead":"7608d22dc32fb91cdd87f9cb53c670b24a57c265","license":"ISC","scripts":{"test":"mocha test/**/*.ts","bench":"node scripts/micro-bench","build":"cross-env NODE_ENV=umd rollup -c","clean":"rimraf lib dist build coverage","minify":"cross-env NODE_ENV=minify rollup -c","pretest":"tsc --sourceMap --skipLibCheck -t es2015 --m umd","coverage":"rimraf build && npm run pretest && nyc mocha ./build/test/**/*.js","lint:src":"tslint src/**/*.ts src/**/*.tsx","prebuild":"tsc --skipLibCheck -t es2015 --m es2015","build:lib":"tsc --skipLibCheck -t es2015 --m commonjs && rimraf lib && shx cp -R build/src lib","lint:tests":"tslint test/**/*.ts test/**/*.tsx","prepublish":"npm run build","watch:build":"tsc --skipLibCheck -t es2015 --m es2015 -w","watch:tests":"mocha test/**/*.ts --watch","post_coverage":"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"_npmUser":{"name":"kennyf","email":"kfrachelle123@gmail.com"},"homepage":"https://github.com/cherow/cherow","keywords":["parsing","ecmascript","typescript","parser","performance","tolerant","parsing","mobile","tablet","estree","es2018","es2017","esnext","javascript","ast","tolerant","lightweight"],"repository":{"url":"git+https://github.com/cherow/cherow.git","type":"git"},"_npmVersion":"5.6.0","description":"Fast and lightweight, standard-compliant javascript parser written in ECMAScript","directories":{},"maintainers":[{"name":"kennyf","email":"kflash123@gmail.com"}],"_nodeVersion":"9.5.0","dependencies":{"npm":"^5.8.0","update":"^0.7.4","clean-assert":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^11.4.1","shx":"^0.2.2","mocha":"^5.0.5","rimraf":"^2.6.2","rollup":"^0.57.1","tslint":"5.9.1","ts-node":"^5.0.1","coveralls":"^3.0.0","cross-env":"^5.1.3","typescript":"^2.8.1","@types/node":"^9.4.6","@types/mocha":"^2.2.48","unicode-10.0.0":"^0.7.5","rollup-plugin-buble":"^0.19.2","rollup-plugin-uglify":"3.0.0","rollup-plugin-replace":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cherow_4.9.2018924_1523191210407_0.11833314603193346","host":"s3://npm-registry-packages"},"_id":"cherow@4.9.2018924","version":"4.9.2018924"}