Simple JavaScript IDE

老子叫甜甜 提交于 2019-12-09 05:39:24

问题


I am brand new to JavaScript and I would like practice my skills using a simple windows based IDE. While learning I do not want to use any CSS or HTML. I would like if possible to have colour single stepping, highlighting and syntax checking.

So for example you could type in your function(s), call it and receive the result

function squareNumber(x) {
  return x*x;
}

squareNumber(5)

25

I would like something better than the Internet Explorer console.


回答1:


There are a lot of good online IDEs at the moment. One of my favorites is JSFiddle, but you said you don't want to use CSS and HTML so it's superfluous in this case. You can use JSBin, opening only the Javascript and Console panels. Another very good one is, in my opinion, Ideone, which has a lot of languages(for JS you have to select Javascript Spidermonkey). The last one I suggest you is JSConsole, from the creator of JSBin, which is basically an enhanced Javascript console(as the name states).




回答2:


Have a look at either,

  • WebStorm: real JavaScript IDE (possibly the best.)
  • Sublime Text 2: text editor with syntax highlighting, and possibility to install plugins.

You can use either software, together with node.js, to get what you want.

Executing the file,

function squareNumber(x) {
    return x * x;
}

console.log(squareNumber(5));

with node.js will output,

25



回答3:


Ended up using this IDE as I could run it on a low powered Laptop. Free Version

http://brackets.io/

There is also a free offering from Microsoft with Visual Studio 2015 called "Visual Studio Code" runs on Macs and linux too. Only used it for a day but it work great on my low powered tablet.

https://code.visualstudio.com/




回答4:


Besides the options listed in the answers above; these are additional options I use when I need to write/test JS without HTML/CSS :

1) Firefox Developer Edition - ScratchPad

The Firefox Developer Edition browser offers a good console with all the necessary features to write JavaScript.

To cite a specific feature - ScratchPad provides you with a good option to write JS code and you can use the run button to view it on the console.

As you can see below it has the syntax coloring and even the options to save and open files directly from your computer.

You can open the Firefox ScratchPad as an independent window using the shortcut - SHIFT+F4

It features code completion, inline documentation and much more, you can learn more about using it from the official documentation here - https://developer.mozilla.org/en-US/docs/Tools/Scratchpad

Keyboard Shortcuts

CTRL + L - To display selected code

CTRL + SPACE - Code Hinting

CTRL + R - Run Command

CTRL + I - Inspect Command

2) Node CMD or CMD + Node

I also like using node + CMD since they work seamlessly. For this option, you need to install node.js and use the CMD to write and test your JS code.

You can also consider using the node.js CMD that works like the windows CMD.

You can change the background color and the text color of the Node CMD by clicking on the top bar and choosing properties

For syntax coloring on Node when using node, you can add one of the syntax coloring npm packages as illustrated below :

I installed the cli-color npm package in these four steps :

1) Check if npm is installed using the nmp -v

2) Install your preferred package using npm install <name of package>

3) Include the package

4) Test the package and view the results

NOTE: It important to check out the documentation of each package esp on the usage since there may be differences.

These are two of my favorite Node.js syntax highlighting packages :

https://www.npmjs.com/package/cli-color and https://www.npmjs.com/package/cli-highlight



来源:https://stackoverflow.com/questions/17132593/simple-javascript-ide

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!