Gathering detailed insights and metrics for estree-to-babel
Gathering detailed insights and metrics for estree-to-babel
Gathering detailed insights and metrics for estree-to-babel
Gathering detailed insights and metrics for estree-to-babel
@babel/eslint-parser
ESLint parser that allows for linting of experimental syntax transformed by Babel
astring
JavaScript code generator from an ESTree-compliant AST.
@typescript-eslint/typescript-estree
A parser that converts TypeScript source code into an ESTree compatible form
@types/estree
TypeScript definitions for estree
npm install estree-to-babel
estree-to-babel v10.0.1
Published on 06 Nov 2024
estree-to-babel v10.0.0
Published on 26 Oct 2024
estree-to-babel v9.1.0
Published on 27 Jul 2024
estree-to-babel v9.0.0
Published on 11 Dec 2023
estree-to-babel v8.1.1
Published on 19 Oct 2023
estree-to-babel v8.1.0
Published on 19 Oct 2023
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
34 Stars
264 Commits
7 Forks
3 Watching
1 Branches
6 Contributors
Updated on 06 Nov 2024
JavaScript (98.19%)
TypeScript (1.81%)
Cumulative downloads
Total Downloads
Last day
-3.4%
258,308
Compared to previous day
Last week
-1.6%
1,315,577
Compared to previous week
Last month
5.7%
5,815,027
Compared to previous month
Last year
-42.6%
93,967,081
Compared to previous year
Convert ESTree
-compatible JavaScript AST
to Babel AST
.
To use parsers like:
With babel
tools like:
@babel/traverse
@babel/types
The thing is @babel/parser
has a little differences with estree
standard:
Property
of ObjectExpression
and ObjectPattern
called ObjectProperty
;FunctionExpression
of a Property
located in ObjectMethod
node;File
node;StringLiteral
, NumericLiteral
, NullLiteral
, RegExpLiteral
, BooleanLiteral
instead of Literal
;ClassMethod
instead of MethodDefinition
;ClassPrivateMethod
;ClassPrivateName
stores name as Identifier
in id
field;ClassPrivateProperty
instead of FieldDefinition
;OptionalMemberExpression
and OptionalCallExpression
instead of ChainExpression
;ImportDeclaration
and ExportNamedDeclaration
has attributes
;JSXText
has extra
field;Also @babel/parser
has differences with typescript-estree
:
ClassPrivateProperty
instead of PropertyDefinition
when key.type=PrivateName
;ClasseProperty
instead of PropertyDefinition
when key.type=Identifier
;PrivateName
instead of PrivateIdentifier
;TSQualifiedName
instead of MemberExpression
in TSInterfaceHeritage
;TSDeclaredMethod
with abstract=true
instead of TSAbstractMethodDefinition
;estree-to-babel
aims to smooth this differences.
npm i estree-to-babel
1const cherow = require('cherow'); 2const toBabel = require('estree-to-babel'); 3const traverse = require('@babel/traverse').default; 4 5const ast = toBabel(cherow.parse(` 6 const f = ({a}) => a; 7`)); 8 9traverse({ 10 ObjectProperty(path) { 11 console.log(path.value.name); 12 // output 13 'a'; 14 }, 15});
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More