# js2-mode

> major-mode for editing JavaScript in Emacs

**Wikidata**: [Q110304860](https://www.wikidata.org/wiki/Q110304860)  
**Source**: https://4ort.xyz/entity/js2-mode

## Summary
js2-mode is a major-mode for editing JavaScript code in Emacs, providing enhanced syntax highlighting and code analysis capabilities. It was created by programmer Steve Yegge in 2008 and is part of the GNU Project, distributed as free software through the GNU Emacs Lisp Package Archive.

## Key Facts
- js2-mode is an Emacs major-mode specifically designed for JavaScript code editing
- Created by American computer programmer Steve Yegge
- First released in 2008, as announced in Yegge's blog post "js2-mode: a new JavaScript mode for Emacs" on March 30, 2008
- Part of the GNU Project since December 25, 2012
- Distributed under free software license as part of the GNU Project
- Written in Emacs Lisp programming language
- Maintained by Steve Yegge since its creation in 2008
- Available through the GNU Emacs Lisp Package Archive (GNU ELPA) as package "js2-mode"
- Latest stable version as of 2021 is 20211229 (released December 29, 2021)

## FAQs
### Q: What is js2-mode used for?
A: js2-mode is an Emacs major-mode designed specifically for editing JavaScript code. It enhances the basic JavaScript editing capabilities available in Emacs by providing features like syntax highlighting, code completion, and error checking.

### Q: Who created js2-mode?
A: js2-mode was created by Steve Yegge, an American computer programmer. He announced the initial release in a blog post on March 30, 2008, and has maintained it since its creation.

### Q: Where can I find js2-mode?
A: js2-mode is available through the GNU Emacs Lisp Package Archive (GNU ELPA) as the package "js2-mode". It can also be found on GitHub at https://github.com/mooz/js2-mode/.

### Q: What programming language is js2-mode written in?
A: js2-mode is written in Emacs Lisp, the dialect of Lisp used in GNU Emacs.

## Why It Matters
js2-mode addresses the need for enhanced JavaScript editing capabilities within Emacs, a highly customizable text editor popular among developers. Before js2-mode, Emacs users had limited options for JavaScript development. By providing a specialized major-mode with features like syntax highlighting, code folding, and improved indentation, js2-mode significantly improved the JavaScript development experience within Emacs. As part of the GNU Project since 2012, it became an officially supported package, expanding its reach and impact. Its continued development and maintenance by Steve Yegge over more than a decade demonstrates its importance in the Emacs ecosystem for JavaScript developers. The availability through GNU ELPA ensures easy installation and updates for Emacs users worldwide.

## Notable For
- One of the earliest specialized JavaScript major-modes for Emacs, predating many modern JavaScript editing packages
- Created by Steve Yegge, a notable figure in the programming community and Emacs ecosystem
- Part of the official GNU Emacs Lisp Package Archive since 2012, giving it official recognition in the GNU ecosystem
- Maintained continuously by its creator since 2008, demonstrating exceptional longevity for a niche Emacs package
- Provides advanced JavaScript parsing and analysis capabilities within Emacs, addressing the specific needs of JavaScript developers using Emacs

## Body
### Overview
js2-mode is a major-mode for editing JavaScript in Emacs. It enhances the basic JavaScript editing capabilities available in Emacs by providing features like syntax highlighting, code completion, and error checking. The package is distributed as free software under terms that allow users to freely run, study, change, and distribute it and modified versions.

### Development History
- Created by American computer programmer Steve Yegge
- First announced on March 30, 2008, in a blog post titled "js2-mode: a new JavaScript mode for Emacs"
- Added to the GNU Emacs Lisp Package Archive (GNU ELPA) on December 25, 2012
- Continuously maintained by Steve Yegge since its creation in 2008
- Part of the GNU Project since joining GNU ELPA in 2012

### Technical Details
- Written in Emacs Lisp programming language
- Distributed under free software license as part of the GNU Project
- Available through GNU ELPA as package "js2-mode"
- Also available on GitHub at https://github.com/mooz/js2-mode/
- Source code hosted on GNU Savannah

### Version History
Multiple stable versions have been released, including:
- 20211229 (December 29, 2021)
- 20201220 (December 20, 2020)
- 20190219 (February 19, 2019)
- 20180301 (March 1, 2018)
- 20170721 (July 21, 2017)
- 20170116 (January 16, 2017)
- 20160623 (June 23, 2016)
- 20150909 (September 10, 2015)
- 20150713 (July 13, 2015)
- 20150202 (February 2, 2015)

### Distribution and Installation
- Available for operating systems including BSD
- Package available in Gentoo as "app-emacs/js2-mode"
- Package available in Ubuntu as "elpa-js2-mode" and "js2-mode"
- Package available in NetBSD as "devel/js2-mode"
- Package available in Debian as "js2-mode"
- Guix package name is "emacs-js2-mode"

## Schema Markup
```json
{
  "@context": "https://schema.org",
  "@type": "Thing",
  "name": "js2-mode",
  "description": "A major-mode for editing JavaScript in Emacs",
  "url": "https://github.com/mooz/js2-mode/",
  "sameAs": [
    "https://elpa.gnu.org/packages/js2-mode.html"
  ],
  "additionalType": "Emacs mode",
  "creator": "Steve Yegge",
  "dateCreated": "2008-03-30",
  "dateModified": "2021-12-29",
  "programmingLanguage": "Emacs Lisp",
  "softwareVersion": "20211229",
  "applicationCategory": "source code editor",
  "applicationSubCategory": "JavaScript mode",
  "operatingSystem": "GNU Emacs",
  "license": "Free software",
  "partOf": "GNU Project"
}

## References

1. [js2-mode: a new JavaScript mode for Emacs. 2008](https://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html)
2. [Js2-Mode version 20211229. 2021](https://lists.gnu.org/archive/html/gnu-emacs-sources/2021-12/msg00064.html)
3. [Source](https://elpa.gnu.org/packages/js2-mode.html)
4. [Source](https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/NEWS.md?h=externals/js2-mode)
5. [js2-mode version 20190219. 2019](https://lists.gnu.org/archive/html/gnu-emacs-sources/2019-02/msg00022.html)
6. [js2-mode version 20180301. 2018](https://lists.gnu.org/archive/html/gnu-emacs-sources/2018-03/msg00000.html)
7. [js2-mode version 20170721. 2017](https://lists.gnu.org/archive/html/gnu-emacs-sources/2017-07/msg00016.html)
8. [js2-mode version 20170116. 2017](https://lists.gnu.org/archive/html/gnu-emacs-sources/2017-01/msg00013.html)
9. [js2-mode version 20160623. 2016](https://lists.gnu.org/archive/html/gnu-emacs-sources/2016-06/msg00017.html)
10. [js2-mode version 20150909. 2015](https://lists.gnu.org/archive/html/gnu-emacs-sources/2015-09/msg00007.html)
11. [js2-mode version 20150713. 2015](https://lists.gnu.org/archive/html/gnu-emacs-sources/2015-07/msg00006.html)
12. [js2-mode version 20150202. 2015](https://lists.gnu.org/archive/html/gnu-emacs-sources/2015-02/msg00004.html)
13. [js2-mode version 20141118. 2014](https://lists.gnu.org/archive/html/gnu-emacs-sources/2014-11/msg00007.html)
14. [js2-mode version 20141115. 2014](https://lists.gnu.org/archive/html/gnu-emacs-sources/2014-11/msg00004.html)
15. [Js2-Mode version 20220710. 2022](https://lists.gnu.org/archive/html/gnu-emacs-sources/2022-07/msg00040.html)
16. [Js2-Mode version 20230408. 2023](https://lists.gnu.org/archive/html/gnu-emacs-sources/2023-04/msg00010.html)
17. [Js2-Mode version 20231224. 2023](https://lists.gnu.org/archive/html/gnu-emacs-sources/2023-12/msg00079.html)