Socket
Socket
Sign inDemoInstall

cherow

Package Overview
Dependencies
Maintainers
1
Versions
536
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cherow - npm Package Compare versions

Comparing version 0.3.9 to 0.4.0

2

package.json
{
"name": "cherow",
"version": "0.3.9",
"version": "0.4.0",
"description": "Fast, standard-compliant ECMAScript parser written in ECMAScript",

@@ -5,0 +5,0 @@ "main": "dist/cherow.js",

@@ -6,24 +6,24 @@ [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/cherow/cherow)

Cherow is a very fast, standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) parser written in ECMAScript.
Cherow is a very fast, standards-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) parser written in ECMAScript.
It strictly follows the ECMAScript® 2018 Language Specification and should parse according these specifications
It strictly follows the ECMAScript® 2018 Language Specification and should parse according to these specifications.
It's safe to use in production.
**Note!** if you find a bug, open a issue ticket and we will try our best to solve it within 30 - 60 minutes.
**Note!** if you find a bug, open an issue ticket and we will try our best to solve it within 30 - 60 minutes.
A online demo can be found [here](https://cherow.github.io/cherow/).
An online demo can be found [here](https://cherow.github.io/cherow/).
## Features
## Features
- Full support for ECMAScript® 2018 [(ECMA-262 8th Edition)](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
- Stage 3 proposals (*experimental*)
- Support for JSX, a syntax extension for React
- Support for [JSX](https://facebook.github.io/react/docs/jsx-in-depth.html), a syntax extension for React
- Skips shebang comment nodes by default
- Optional tracking of syntax node location (index-based and line-column)
- 5200 unit tests
- 5200 unit tests
## ESNext features
`Stage 3` features support. This need to be enabled with the `next` option
`Stage 3` features support. These need to be enabled with the `next` option.

@@ -39,3 +39,3 @@ - Import()

This need to be enabled with the `v8` option
These need to be enabled with the `v8` option.

@@ -55,3 +55,3 @@ - Do expressions

Cherow can be used to perform syntactic analysis of JavaScript program.
Cherow can be used to perform syntactic analysis of JavaScript programs.

@@ -69,5 +69,5 @@ **Note!** there does not exist an `sourceType: module` option for parsing module code. According the ECMAScript specs you should use either `parseScript` or `parseModule`.

```
## Parsing with options
```js

@@ -82,3 +82,3 @@

Single line, multiline and HTML comments are supported, and can be collected as well. Shebang comment node - `#!foo` - are
Single line, multiline and HTML comments are supported, and can be collected as well. Shebang comment nodes (`#!foo`) are
skipped by default, and can't be collected.

@@ -92,5 +92,5 @@

// Function
cherow.parseScript('// foo',
{
comments: function(type, comment, start, end) {}
cherow.parseScript('// foo',
{
comments: function(type, comment, start, end) {}
}

@@ -102,5 +102,5 @@ );

cherow.parseScript('// foo',
{
comments: commentArray
cherow.parseScript('// foo',
{
comments: commentArray
}

@@ -113,11 +113,10 @@ );

The main difference between Cherow and Acorn and Esprima is that the mention libraries either doesn't parse everything
according to TC39, or they doesn't fail as they should according to the ECMAScript specs.
The main difference between Cherow and Acorn/Esprima is that the latter libraries either don't parse everything
according to TC39, or they don't fail as they should according to the ECMAScript specs.
Cherow parses everything after the specs, and fails 90% after the specs (*work in progress*).
Cherow parses everything after the specs, and fails 90% after the specs (*work in progress*).
## Performance and benchmarks
The most important thing for an ECMAScript parser is the performance. Especially important is it when the parser is a
The most important thing for an ECMAScript parser is performance, especially when it is a
dependency in other libraries. Poor performance will slow down the main library.

@@ -134,8 +133,7 @@

However there is a small difference from other parsers because Cherow outputs a `await` property on the `ForStatement` node.
However there is a small difference from other parsers because Cherow outputs an `await` property on the `ForStatement` node.
This because of the `Asynchronous Iteration` implementation.
## Contribution
## Contribution
You are welcome to contribute. As a golden rule - always run benchmarks to verify that you haven't created any

@@ -147,4 +145,3 @@ bottlenecks or did something that you shouldn't.

- Think twice before you try to implement anything
- Minimum 1.5 mill ops/sec for light weight cases, and 800k - 1 mill ops/sec for "heavy" cases
- Avoid duplicating the source code
- Create tests that cover what you have implemented

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc