Sublime Text 3 running the JavaScript console

Source: Internet
Author: User
Tags sublime text



JavaScript console debugging and output in the browser side of the use of the work is commonly used, as the front-end development of the main editor sublime text itself is not support JavaScript output and run. Sometimes we need to look at the effect of the output and have to use the F12 to view the console program. As a plug-in system and its rich editor, we can add the build system method to let sublime text support JavaScript console console debugging.


JSC Mode (Mac OS X)


The 1.MAC includes a JavaScript console program with deep paths:


/system/library/frameworks/javascriptcore.framework/versions/a/resources/jsc


:








2. Start Sublime text,tools > Build System > New build System as shown in:





3. Configure the option contents, save in the default User directory:


{
"cmd": ["/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", "$file"],
"selector": "source.js"
}


:






4. Create a new JS file test console output, it is important to note that the use of debug, but not the use of Console.log, so we recommend the use of the second way to use Nodejs;




Nodejs Way


1. Download the installation Nodejs, if for Nodejs installation unfamiliar can refer to my previous blog;



2. In the second step of repeating JSC mode, add the following to build Sytem:


{
"cmd": ["node", "$file"],
"selector": "source.js"
}


Most of the online introduction is like this, some can be successful, but I am not fortunate that part, cannot succeed, if you have not succeeded can refer to the following ways, terminal run:


which node


Get the path as follows:


/users/keso/.nvm/versions/node/v0.12.7/bin/node


Reconfigure the following:


{
"cmd": ["/Users/keso/.nvm/versions/node/v0.12.7/bin/node", "$file"],
"selector": "source.js"
}


3. Test the output effect:





In both of these two ways can alleviate a part of the development work, recommend the second way ~



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.