Node.js is a platform based on the Chrome JavaScript runtime, which is small and convenient to build. Run the port can be run on the browser, display effect, but every time with the browser is also very troublesome, we are talking about in the sublime Text2 configuration, is JS in the SUBLIMETEXT2 run, no longer need to switch to the browser.
1. First install the Node.js, directly to the official website to download, and then install, click Next to Good, if you need to change the installation path, choose a good installation path can be. After installation, run NODE-V if the version number is displayed, the installation is successful.
2. At this time, we still can not run JS files, first in the sublime Text2 to build a system environment: open Sublime Text-> Tools-> builds-> build system-> the New build S Ystem. Empty the new system and enter
{
"cmd": ["Node", "$file"],
"File_regex": "^[]*file \" (... *?) \ ", line ([0-9]*)",
"Working_dir": "${project_path:${folder}}",
"selector": "Source.js",
"shell": true,
"encoding": "Utf-8",
"Windows": {
"cmd": ["Node", "$file"]
},
"Linux": {
"cmd": ["Killall Node Node ', ' $file ']
}
}
Save and name the Node.sublime-build.
3. At this time in sublime Text2 first CTRL + N a new file and save it as a JS format, such as: Hello.js. Open the Hello.js file that we just built. Ctrl+b to run, you can see the corresponding output in the console
The above discussion sublime Text 3 run JavaScript console is a small set to share all the content, hope to give you a reference, but also hope that we support the cloud-dwelling community.