NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #62 most downloaded on npm
ECMAScript parser
Last release 2 months ago
28 Jul 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 56 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
14 years old
140 releases · first in 2012
The new startLocation option can now be used to tell the parser the line and column the parse starts at (mostly useful with parseExpressionAt ).
The new startLocation option can now be used to tell the parser the line and column the parse starts at (mostly useful with parseExpressionAt).
Reject uses of ** with a non-parenthesized arrow function as left-hand side.
Avoid computing the start line in parseExpressionAt when locations aren't used.
The new strict option can be used to start script sources in strict mode.
The new strict option can be used to start script sources in strict mode.
Fix a number of corner case bugs when using or await using appear in for loop specs.
Disallow new super() expressions.
Don't allow the conditional in a ternary expression to be a (naked) arrow function.
One column per quarter.
The sourceType option can now be set to "commonjs" to have the parser treat the top level scope as a function scope.
The sourceType option can now be set to "commonjs" to have the parser treat the top level scope as a function scope.
Add support for Unicode 17.
Don't recognize await using as contextual keywords when followed directly by a backslash.
Fix an issue where the parser would allow return statements in static blocks when allowReturnOutsideFunction was enabled.
Properly reject using declarations that appear directly in switch or for head scopes.
Fix some corner case issues in the recognition of using syntax.
Support using and await using syntax.
Support using and await using syntax.
The AnyNode type is now defined in such a way that plugins can extend it.
Fix an issue where the bigint property of literal nodes for non-decimal bigints had the wrong format.
The acorn CLI tool no longer crashes when emitting a tree that contains a bigint.
Fix an issue where await expressions in class field initializers were inappropriately allowed.
Fix an issue where await expressions in class field initializers were inappropriately allowed.
Properly allow await inside an async arrow function inside a class field initializer.
Mention the source file name in syntax error messages when given.
Properly add an empty attributes property to every form of ExportNamedDeclaration.
Support ES2025 import attributes.
Support ES2025 import attributes.
Support ES2025 RegExp modifiers.
Support some missing Unicode properties.
New features Upgrade to Unicode 16.0.
Upgrade to Unicode 16.0.
Fix a regression that caused Acorn to no longer run on Node versions <8.10.
Fix a regression that caused Acorn to no longer run on Node versions <8.10.
Fix a regression that caused Acorn to no longer run on Node versions <8.10.
Support ES2025 duplicate capture group names in regular expressions.
Support ES2025 duplicate capture group names in regular expressions.
Include VariableDeclarator in the AnyNode type so that walker objects can refer to it without getting a type error.
Properly raise a parse error for invalid for/of statements using async as binding name.
Properly recognize "use strict" when preceded by a string with an escaped newline.
Mark the Parser constructor as protected, not private, so plugins can extend it without type errors.
Fix a bug where some invalid delete expressions were let through when the operand was parenthesized and preserveParens was enabled.
Properly normalize line endings in raw strings of invalid template tokens.
Properly track line numbers for escaped newlines in strings.
Fix a bug that broke line number accounting after a template literal with invalid escape sequences.
Add Function and Class to the AggregateType type, so that they can be used in walkers without raising a type error.
Add Function and Class to the AggregateType type, so that they can be used in walkers without raising a type error.
Make sure onToken get an import keyword token when parsing import.meta.
Fix a bug where .loc.start could be undefined for new.target meta nodes.
Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.
Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.
Fix a regression where onToken would receive 'name' tokens for 'new' keyword tokens.
Fix a regression where onToken would receive 'name' tokens for 'new' keyword tokens.
Fix an issue where tokenizing (without parsing) an object literal with a property named class or function could, in some circumstance, put the tokeniz
Fix an issue where tokenizing (without parsing) an object literal with a property named class or function could, in some circumstance, put the tokenizer into an invalid state.
Fix an issue where a slash after a call to a propery named the same as some keywords would be tokenized as a regular expression.
Upgrade to Unicode 15.1.
Use a set of new, much more precise, TypeScript types.
Add a checkPrivateFields option that disables strict checking of private property use.
Add a checkPrivateFields option that disables strict checking of private property use.
Forbid dynamic import after new, even when part of a member expression.
Forbid dynamic import after new, even when part of a member expression.
Add Unicode properties for ES2023.
Add support for the v flag to regular expressions.
Fix a bug that caused allowHashBang to be set to false when not provided, even with ecmaVersion >= 14.
Fix a bug that caused allowHashBang to be set to false when not provided, even with ecmaVersion >= 14.
Fix an exception when passing no option object to parse or new Parser.
Fix incorrect parse error on if (0) let\n[astral identifier char].
Make type for Comment compatible with estree types.
Make type for Comment compatible with estree types.
Allow parentheses around spread args in destructuring object assignment.
Allow parentheses around spread args in destructuring object assignment.
Fix an issue where the tree contained directive properties in when parsing with a language version that doesn't support them.
Support hashbang comments by default in ECMAScript 2023 and later.
Stop handling "use strict" directives in ECMAScript versions before 5.
Stop handling "use strict" directives in ECMAScript versions before 5.
Fix an issue where duplicate quoted export names in export * syntax were incorrectly checked.
Add missing type for tokTypes.
Add support for Unicode 13 properties in regular expressions.
Support quoted export names.
Upgrade to Unicode 14.
Add support for Unicode 13 properties in regular expressions.
Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.
Fix a bug where an object literal with multiple __proto__ properties would incorrectly be accepted if a later property value held an assigment.
Fix a bug where an object literal with multiple __proto__ properties would incorrectly be accepted if a later property value held an assigment.
Support class private fields with the in operator.
Improve context-dependent tokenization in a number of corner cases.
Improve context-dependent tokenization in a number of corner cases.
Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
Fix an issue where arrow function bodies in for loop context would inappropriately consume in operators.
Fix wrong end locations stored on SequenceExpression nodes.
Implement restriction that for/of loop LHS can't start with let.
Add support for ES2022 class static blocks.
Allow multiple input files to be passed to the CLI tool.
Fix a bug where allowAwaitOutsideFunction would allow await in class field initializers, and setting ecmaVersion to 13 or higher would allow top-level
Fix a bug where allowAwaitOutsideFunction would allow await in class field initializers, and setting ecmaVersion to 13 or higher would allow top-level await in non-module sources.
A new option, allowSuperOutsideMethod, can be used to suppress the error when super is used in the wrong context.
A new option, allowSuperOutsideMethod, can be used to suppress the error when super is used in the wrong context.
Default allowAwaitOutsideFunction to true for ECMAScript 2022 an higher.
Default allowAwaitOutsideFunction to true for ECMAScript 2022 an higher.
Add support for the d (indices) regexp flag.
Fix spec conformity in corner case 'for await (async of ...)'.
Fix spec conformity in corner case 'for await (async of ...)'.
Fix an issue where the library couldn't parse 'for (async of ...)'.
Fix an issue where the library couldn't parse 'for (async of ...)'.
Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.
Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions
Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.
Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.
Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.
Add support for ES2022 class fields and private methods.
Add support for ES2022 class fields and private methods.
Stop shipping source maps in the NPM package.
Stop shipping source maps in the NPM package.
Fix a spurious error in nested destructuring arrays.
Fix a spurious error in nested destructuring arrays.
Expose allowAwaitOutsideFunction in CLI interface.
Make allowImportExportAnywhere also apply to import.meta.
Adjust package.json to work with Node 12.16.0 and 13.0-13.6.
Adjust package.json to work with Node 12.16.0 and 13.0-13.6.
Make await x y an error, following the spec.
Make await x ** y an error, following the spec.
Fix potentially exponential regular expression.
Fix a wasteful loop during Parser creation when setting ecmaVersion to "latest".
Fix a wasteful loop during Parser creation when setting ecmaVersion to "latest".
Make the TypeScript types reflect the current allowed values for ecmaVersion.
Make the TypeScript types reflect the current allowed values for ecmaVersion.
Fix another regexp/division tokenizer issue.
Provide the correct value in the version export.
Provide the correct value in the version export.
Disallow expressions like (a = b) = c.
Disallow expressions like (a = b) = c.
Make non-octal escape sequences a syntax error in strict mode.
The package can now be loaded directly as an ECMAScript module in node 13+.
Update to the set of Unicode properties from ES2021.
The ecmaVersion option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
Some changes to method signatures that may be used by plugins.
Nothing published for this version
Add support for logical assignment operators.
Add support for logical assignment operators.
Add support for numeric separators.
Make the string in the version export match the actual library version.
Make the string in the version export match the actual library version.
Fix a bug that caused parsing of object patterns with a property named set that had a default value to fail.
Fix a bug that caused parsing of object patterns with a property named set that had a default value to fail.
Add support for optional chaining (?.).
Fix precedence issue in parsing of async arrow functions.
Fix precedence issue in parsing of async arrow functions.
Add support for nullish coalescing.
Add support for import.meta.
Support export * as ... syntax.
Upgrade to Unicode 13.
Treat \8 and \9 as invalid escapes in template strings.
Treat \8 and \9 as invalid escapes in template strings.
Allow unicode escapes in property names that are keywords.
Don't error on an exponential operator expression as argument to await.
More carefully check for valid UTF16 surrogate pairs in regexp validator.
Disallow trailing object literal commas when ecmaVersion is less than 5.
Disallow trailing object literal commas when ecmaVersion is less than 5.
Add a static acorn property to the Parser class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
Changes the node format for dynamic imports to use the ImportExpression node type, as defined in ESTree.
Changes the node format for dynamic imports to use the ImportExpression node type, as defined in ESTree.
Makes 10 (ES2019) the default value for the ecmaVersion option.
Nothing published for this version
More carefully check for valid UTF16 surrogate pairs in regexp validator.
More carefully check for valid UTF16 surrogate pairs in regexp validator.
Nothing published for this version
sourceType: "module" can now be used even when ecmaVersion is less than 6, to parse module-style code that otherwise conforms to an older standard.
sourceType: "module" can now be used even when ecmaVersion is less than 6, to parse module-style code that otherwise conforms to an older standard.
Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
Fix issue where setting the allowReserved option to "never" allowed reserved words in some circumstances.
Improve valid assignment checking in for/in and for/of loops.
Improve valid assignment checking in for/in and for/of loops.
Disallow binding let in patterns.
Support bigint syntax with ecmaVersion >= 11.
Support dynamic import syntax with ecmaVersion >= 11.
Upgrade to Unicode version 12.
Fix bug that caused parsing default exports of with names to fail.
Fix bug that caused parsing default exports of with names to fail.
Fix scope checking when redefining a var as a lexical binding.
Fix scope checking when redefining a var as a lexical binding.
Split up parseSubscripts to use an internal parseSubscript method to make it easier to extend with plugins.
Check that exported bindings are defined.
Check that exported bindings are defined.
Don't treat \u180e as a whitespace character.
Check for duplicate parameter names in methods.
Don't allow shorthand properties when they are generators or async methods.
Forbid binding await in async arrow function's parameter list.
The content of class declarations and expressions is now always parsed in strict mode.
The content of class declarations and expressions is now always parsed in strict mode.
Don't allow let or const to bind the variable name let.
Treat class declarations as lexical.
Don't allow a generator function declaration as the sole body of an if or else.
Ignore "use strict" when after an empty statement.
Allow string line continuations with special line terminator characters.
Treat for bodies as part of the for scope when checking for conflicting bindings.
Fix bug with parsing yield in a for loop initializer.
Implement special cases around scope checking for functions.
Fix TypeScript type for Parser.extend and add allowAwaitOutsideFunction to options type.
Fix TypeScript type for Parser.extend and add allowAwaitOutsideFunction to options type.
Don't treat let as a keyword when the next token is { on the next line.
Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when preserveParens was on.
Further improvements to tokenizing regular expressions in corner cases.
Further improvements to tokenizing regular expressions in corner cases.
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
Remove stray symlink in the package tarball.
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
Your coding agent can read these notes before it upgrades. Set up the MCP server →