SoFunction
Updated on 2025-04-06

A brief discussion on the JavaScript console running in Sublime Text 3

It is a platform built based on Chrome JavaScript runtime, which is compact and convenient to build. The running port can be run on the browser and displays the effect, but it is quite troublesome to use the browser every time. What we are talking about here is configuring in sublime text2. Yes, js runs in sublimetext2 and you no longer have to switch to the browser.

1. First install it, go to the official website to download it, then install it, just click Next. If you need to change the installation path, just select the installation path. After installation, run node -v. If the version number is displayed, the installation is successful.

2. At this time, we still cannot run js files. We must first build a system environment in sublime text2: open Sublime Text -> Tools -> Build -> Build System -> New Build System. Clear the newly created system and enter

{
"cmd": ["node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"working_dir": "${project_path:${folder}}",
"selector": "",
"shell": true,
"encoding": "utf-8",
"windows": {
"cmd": ["node", "$file"]
},
"linux": {
"cmd": ["killall node; node", "$file"]
}
}

Save and name it -build.

3. At this time, first Ctrl+N in sublime text2 and save it in js format, such as:. Open the file we just created. Ctrl+B runs and you can see the corresponding output in the console

The above article briefly talks about the JavaScript console running in Sublime Text 3 is all the content I share with you. I hope you can give you a reference and I hope you can support me more.