# JavaScript ## Which browsers are supported? In theory, all browsers supporting ECMAScript 5.1. In practice, this target has been extensively tested against: * Firefox 34.0.5 * Safari 8.0.2 * Chrome 39.0.2171 * Explorer 11.0.3 The above tests were conducted using Selenium. No issue was found, so you should find that the runtime works pretty much against any recent JavaScript engine. ## Is NodeJS supported? The runtime has also been extensively tested against Node.js 14 LTS. No issue was found. NodeJS together with a packaging tool is now the preferred development path, developers are encouraged to follow it. ## What about modules? Starting with version 8.1, Antlr4 JavaScript runtime follows esm semantics (see https://tc39.es/ecma262/#sec-modules for details) Generated lexers, parsers, listeners and visitors also follow this new standard. If you have used previous versions of the runtime, you will need to migrate and make your parser a module. ## How to create a JavaScript lexer or parser? This is pretty much the same as creating a Java lexer or parser, except you need to specify the language target, for example: ```bash $ antlr4 -Dlanguage=JavaScript MyGrammar.g4 ``` For a full list of antlr4 tool options, please visit the [tool documentation page](tool-options.md). ## Where can I get the runtime? Once you've generated the lexer and/or parser code, you need to download the runtime. The JavaScript runtime is [available from npm](https://www.npmjs.com/package/antlr4). If you can't use npm, the JavaScript runtime is also available from the ANTLR web site [download section](http://www.antlr.org/download/index.html). The runtime is provided in the form of source code, so no additional installation is required. We will not document here how to refer to the runtime from your project, since this would differ a lot depending on your project type and IDE. ## How do I get the runtime in my browser? The runtime is quite big and is currently maintained in the form of around 50 scripts, which follow the same structure as the runtimes for other targets (Java, C#, Python...). This structure is key in keeping code maintainable and consistent across targets. However, it would be a bit of a problem when it comes to get it into a browser. Nobody wants to write 50 times: ```