官术网_书友最值得收藏!

Choosing editors and debuggers for Node.js

Since Node.js code is JavaScript, any JavaScript-aware editor will be useful. Unlike some other languages that are so complex that an IDE with code completion is a necessity, a simple programming editor is perfectly sufficient for Node.js development.

Two editors are worth shouting out because they are written in Node.js: Atom and Microsoft Visual Studio Code. 

Atom (https://atom.io/) describes itself as a hackable editor for the 21st century. It is extendable by writing Node.js modules using the Atom API and the configuration files are easily editable. In other words, it's hackable in the same way plenty of other editors have been—going back to Emacs, meaning you write a software module to add capabilities to the editor. The Electron framework was invented in order to build Atom and it is is a super-easy way of building desktop applications using Node.js.

Microsoft Visual Studio Code (https://code.visualstudio.com/) is a hackable editor (well, the home page says extensible and customizable, which means the same thing) that is also open source and implemented in Electron. However, it's not a hollow me-too editor, copying Atom while adding nothing of its own. Instead, Visual Studio Code is a solid programmer's editor in its own right, bringing interesting functionality to the table.

As for debuggers, there are several interesting choices. Starting with Node.js 6.3, the inspector protocol has made it possible to use the Google Chrome debugger. Visual Studio Code has a built-in debugger that also uses the inspector protocol.

For a full list of debugging options and tools, see https://nodejs.org/en/docs/guides/debugging-getting-started/.

Another task related to the editor is adding extensions to help with the editing experience. Most programmer-oriented editors allow you to extend the behavior and assist with writing the code. A trivial example is syntax coloring for JavaScript, CSS, HTML, and so on. Code completion extensions are where the editor helps you write the code. Some extensions scan code for common errors; often these extensions use the word lint. Some extensions help to run unit test frameworks. Since there are so many editors available, we cannot provide specific suggestions.  

For some, the choice of programming editor is a serious matter defended with fervor, so we carefully recommend that you use whatever editor you prefer, as long as it helps you edit JavaScript code. Next, we will learn about the Node.js commands and a little about running Node.js scripts.

主站蜘蛛池模板: 特克斯县| 清河县| 翁牛特旗| 福州市| 合江县| 惠水县| 绥宁县| 建阳市| 嘉峪关市| 平昌县| 威海市| 乌兰察布市| 郑州市| 林西县| 阿合奇县| 富平县| 望江县| 潞城市| 新河县| 汝南县| 舟曲县| 潼关县| 鄂托克前旗| 巴塘县| 邯郸县| 津市市| 尼玛县| 昌黎县| 乌拉特中旗| 金山区| 通城县| 广德县| 宁德市| 吉安市| 昭平县| 镇康县| 汕尾市| 株洲市| 平邑县| 德州市| 漠河县|