Sublime Text 3 running the JavaScript console

Source: Internet
Author: User
Tags install node sublime text

node. JS is a platform built on the chrome JavaScript runtime and is small and easy to build. Run the port can run in the browser, display the effect, but every time with the browser is also very troublesome, we are talking about in sublime Text2 configuration, is JS in Sublimetext2 run, no longer switch to the browser.

1. First install node. js, directly to the official website to download, and then install, click on the next step, if you need to change the installation path, choose a good installation path. After installation, run NODE-V if the version number is displayed, the installation is successful.

2. At this time, we still can not run the JS file, the first to build a system environment in the sublime Text2: Open Sublime Text--Tools---build-build system--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 create a new file and save as JS format, such as: Hello.js. Open the Hello.js file that we just created. Ctrl+b to run, you can see the corresponding output in the console

Sublime Text 3 running the JavaScript console

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.