can edit and compile it in vs2013.Of course, you can also directly use the node-gyp build command to compile.The test js program is as follows: The code is as follows:Var hello = require ('./hello ');Console. log (hello. hello ());Some problems were encountered, as shown below:1. C: \ Users \ Administrator. node-gyp \ 0.10.33 directory does not have the default
My Node. js learning path (4) -- unit test and node. js unit test
NPM installation:
Npm install nodeunit-g
Supports command line and browser running. Various assertions. In node. js, modularize the method to export exports. If it
This article mainly introduces how to use Meteor with Node. js Code example of real-time chat application, Node. as an asynchronous framework, js is used to compile real-time applications. For more information, see Derby. the framework for js comparison is Meteor.
In the professional software development process, no matter what platform language, now UnitTest is required. Node. js has the Assert of built-in. Today, let's take a look at the Node. js unit test. Here we use nodeunit for NPM installation:
Npm install nodeunit-g
Supports command line and browser running. Various ass
The console. trace Method in node. js is used in node. js scenarios.
Method description:
Outputs the current call stack to the standard error stream.
Syntax:
Copy codeThe Code is as follows:Console. trace (label)
Receiving parameters:
Label
Example:
Copy codeThe Code is as follows:Console. trace ();// Running result:Tr
3.1 Console/19 in node. js3.1.1 Console.log method/193.1.2 Console.error Method/203.1.3 Console.dir Method/213.1.4 Console.time Method and Console.timeend method/223.1.5 Console.trace Method/223.1.6 Console.assert Method/233.2 Global scope and global functions in node. js/233.2.1 Global scope/23 in node. js3.2.2 settim
This article mainly introduces Node. example of calling the mysql stored procedure in js. this article passes the test in the windows environment. This article also provides examples of creating a database, inputting data, creating a stored procedure, and calling a stored procedure, for more information, see the example below. it is only tested in windows and not in linux. If you have any questions, please
module ):
The Code is as follows:
Npm install supervisor-g
Assume that the main portal of your Node. js program is app. js, you only need to execute the following command to start monitoring file changes.
The Code is as follows:
Supervisor app. js
The Supervisor also supports multiple parameters, as shown below:
1. What is the breakpoint debugging? It is not difficult to be difficult.
Breakpoint debugging is not really a complex thing, simple understanding is not outside the call is to open the browser, open sources find JS file, the line number on the point. The operation seems very simple, in fact, many people tangle is where to break the point. (Let's look at a scre
"" install "" node-inspector"
The module cannot be automatically installed even though it is in Russia. If there is an error, You can manually install the module ..
# ------------- Debug node-inspector/eclipse/webstorm
Node. js itself supports debugging (gdb is also not
set to the node being deleted, any change in the properties of the node, or a change in one of its child nodes.3. Ajax BreakpointsXHR breakpoints, or Ajax breakpoints, just like their names, lets us set a breakpoint that triggers when the feature's Ajax call occurs.This is very effective when you are debugging a web app's network transfer.4. Mobile Device Simula
Installation is needless to say, very simple, in Firefox plugin library to find Firebug on the OK. The following figure is the Firebug Debug window.
Firebug Art use is very common, the company art sister with very skilled oh, and for our developers, mainly with it to debug JS. Look at the official introduction to the Debug
compiles them into html and finally delivers them to the client (browser). Here I am using ejs, and its syntax is similar to html.
3. To run the server, enter node app in the command line. If webstorm is used, you can directly debug app. js. webstorm supports node. js very
5 Debug tips required for JS debuggingI've been using the printf debugger, which is generally smooth, but sometimes you'll find that you need a better approach. Here are a few JavaScript tips that you'll find very useful.1. Debugger;As I've said before, you can add a sentence to the JavaScript code debugger; to manually create a breakpoint effect.Do you need a
Common Methods for JavaScript MySQL operations in Node. js, node. jsmysql
1. Create a database connection: createConnection (Object) MethodThis method accepts an object as a parameter. This object has four common attributes: host, user, password, and database. The parameter is the same as the parameter used to connect to a database in php. The attribute list is a
. JSON in interactive mode
NPM adduser generates users on the node repo website through interaction
NPM publish can publish the package. If necessary, update the version number in package. JSON and re-publish.
NPM unpublish can unpack
3.3 debugging
3.3.1 node debug
Node debug
\":\"test11\"}}" http://localhost:3000/leaderboards
View the TOP 10 commands as follows:
curl http://localhost:3000/leaderboards
In standard REST definitions, POST and PUT have different meanings. GET can distinguish a single resource or a list of resources. We have simplified this application. Both ADD and UPDATE use POST in a unified manner, and there is no distinction between a single resource and a list. The TOP 10 Data is directly returned.
Some preparations
Install
This article mainly introduces node. socket. js. i/O advanced usage skills. This article describes the configuration, room, event, authorization, and other content. For more information, see Socket in the previous blog. IO, I briefly introduced Socket. i/O basic usage and a simple chat room DEMO is created. This article will continue to explore the advanced usage of Socket. IO Based on the introduction. Thi
://127.0.0.1:8080/?port=58584. Open the JS file you want to debug, such as App.js, and break the breakpoint in the code: debugger; For example:5.cmd into Project file app.js execution Entry file: node--debug app.js6. Refresh the browser you just opened:7. Test: I need to pos
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.