0.20.1 • Published 2 months ago

hermes-parser v0.20.1

Weekly downloads
24
License
MIT
Repository
github
Last release
2 months ago

hermes-parser

A JavaScript parser built from the Hermes engine's parser compiled to WebAssembly. Can parse ES6, Flow, and JSX syntax.

API

The Hermes parser exposes a single parse(code, [options]) function, where code is the source code to parse as a string, and options is an optional object that may contain the following properties:

  • babel: boolean, defaults to false. If true, output an AST conforming to Babel's AST format. If false, output an AST conforming to the ESTree AST format.
  • allowReturnOutsideFunction: boolean, defaults to false. If true, do not error on return statements found outside functions.
  • flow: "all" or "detect", defaults to "detect". If "detect", only parse syntax as Flow syntax where it is ambiguous whether it is a Flow feature or regular JavaScript when the @flow pragma is present in the file. Otherwise if "all", always parse ambiguous syntax as Flow syntax regardless of the presence of an @flow pragma. For example foo<T>(x) in a file without an @flow pragma will be parsed as two comparisons if set to "detect", otherwise if set to "all" or the @flow pragma is included it will be parsed as a call expression with a type argument.
  • sourceFilename: string, defaults to null. The filename corresponding to the code that is to be parsed. If non-null, the filename will be added to all source locations in the output AST.
  • sourceType: "module", "script", or "unambiguous" (default). If "unambiguous", source type will be automatically detected and set to "module" if any ES6 imports or exports are present in the code, otherwise source type will be set to "script".
  • tokens: boolean, defaults to false. If true, add all tokens to a tokens property on the root node.
@react-native/babel-transformereasy-select-rnreact-native-shekhar-bridge-testwilscanner@oiti/documentoscopy-react-nativequoc-testreact-native-slider-kf@infinitebrahmanuniverse/nolb-herluminos-ui-core@everything-registry/sub-chunk-1840jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_sampleagent-get-agent@adembacaj/react-native-google-pay@_nomtek/react-native-shimmer-animationact_mvvm_shop_cart@affinidi/affinidi-auth-sdk-kernelaffinidi-auth-sdk-kerneljrennsoh88-react-native-scroll-indicatorjordy-frijters-test-libwifi_configuration_packagehermes-eslinthermes-transformarchlibrarygriffin-ui-library@cs6/react-native-test-native-view-libraryawesome-module-kdvision-camera-plugin-face-detector@azalpacir/react-native-dhp-printer@aysea/react-native-ui-library@baloochat/react-native-svg-uri@bemobile/fusion-server@amirdiafi/react-native-ios-haptics@brantalikp/rn-resizebiometric-st@assystant/firebase@con-test/react-native-concent-commoncreate-flow-upgrade@glyw/react-native-tabbed-section-list@ali5049/react-native-buttons@blusalt-sdk/react-native-blusalt-document-verificationvision-camera-base64-resizedbabel-plugin-syntax-hermes-parserzeo-collectcheckbox-componentjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwyreact-native-experts-sdktest_lib_module_aar@sidghimire/react-native-mapbox-navigation@sephriot/react-native-persistable-uri@status-im/react-native-transparent-video@tg1518/react-native-lewin-aliyunplayerframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_new@trackier/react-native-trackierfmslrn-keyboard-avoiding-viewrn-counter-demorn-my-libraryrn-use-modal-hookrn_unique_device_idrn-horizontal-list@routebuddies/react-native-mapbox-navigation@rnx-kit-metro/metro@rnx-kit-metro/metro-babel-transformer@rnx-kit-metro/metro-react-native-babel-transformer@react-native-ui-design/button@react-native/codegen@react-native/metro-babel-transformerrn-check-btnrn-circular-chartsmart_one_connect@taingo97/react-native-awesome-module@taingo97/react-native-bluetooth-escpos-printer@taingo97/react-native-bluetooth-xprinter@taingo97/react-native-generate-key-rsa@taingo97/react-native-key-rsa@taingo97/react-native-print-xprinter@taingo97/react-native-rsa-expo@taingo97/react-native-sunmi-printerfawaterak-online-paymentfawatrak-online-paymenttest-npm-jjmessitest-library-123rn-agora-ios-mrn-pay-sdk@thinxviewx/core-rnflow-api-translatorflow-nodeflow-remove-typesflow-upgrade
0.20.1

2 months ago

0.20.0

2 months ago

0.19.2

2 months ago

0.19.1

3 months ago

0.19.0

3 months ago

0.18.2

4 months ago

0.18.1

5 months ago

0.17.0

7 months ago

0.18.0

5 months ago

0.17.1

6 months ago

0.16.0

7 months ago

0.12.0

11 months ago

0.13.0

10 months ago

0.12.1

11 months ago

0.14.0

10 months ago

0.13.1

10 months ago

0.15.0

9 months ago

0.15.1

9 months ago

0.11.0

1 year ago

0.11.1

1 year ago

0.10.0

1 year ago

0.10.1

1 year ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.5.0

2 years ago

0.6.0

2 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago