Talking about Sublime Text 3 running JavaScript console _javascript tips

Source: Internet
Author: User
Tags sublime text

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.

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.