Node Debug Path-----jshint I'm not going to brag about node's advantages, it makes it possible for JavaScript to unify the front and back of the web. But for beginners, the server side of the JS code may not be as good as the client side of the code debugging, intuitive. The debugging of client-side JS code has basical
Node. js debugging skills, node. js debugging
Author: zhanhailiang Date:
1. console. log
Similar to front-end debugging, code debugging is performed by printing related variables step by step.
2. Use the Node. js built-in Debugger
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:
Npm is a module dependency management tool for Node. js. As a tool used by developers, it mainly solves problems encountered during Node. js development. Like RubyGems's importance to Ruby developers and Maven for Java developers, npm's importance to Node.
testing. (By The Way, please look forward to the upcoming articles about the load testing by Lloyd)
After two days of hard work, he finally found the culprit in the Node kernel: The Event listener in http. ClientRequest was not released. (The patch that finally fixes this problem has only two but crucial letters ). This painful experience prompted Lloyd to write a tool that can help find memory leaks.
Memory Leak locating Tool
There are already many
testing. (By the way, please look forward to the upcoming articles about the load testing by Lloyd)
After two days of hard work, he finally found the culprit in the Node Kernel: The event listener in http. ClientRequest was not released. (The patch that finally fixes this problem has only two but crucial letters ). This painful experience prompted Lloyd to write a tool that can help find memory leaks.
Memory leak locating tool
There are already many
supported. The documentation and demo code are not complete and there are not many users.
1. Implement Node. JS components using pure js(1) Run npm init in the helloworld directory to initialize package. json. The options are ignored by default.
(2) component implementation index. js, for example:
module.exports.Hell
Coder Compare preferences Debug, Debug node More trouble, we rely on the tall tool webstorm (I use 10) to debug node, configuration is relatively simple, direct:First, configure the node environment, select "Edit/configuration" in
Asynchronous programming practices of when. js under node. js, node. jswhen. js
Assume a business scenario:
Get and save the rss feed to a file through the rss address, and save the rss address to the file.
To complete the business in this scenario, you need to complete thre
This article mainly introduces the asynchronous programming practices of when. js under node. js. If you need it, you can refer to the following assumptions for a business scenario:
Get and save the rss feed to a file through the rss address, and save the rss address to the file.
To complete the business in this scenario, you need to complete three tasks:
1. Rea
Node. js entry-create a project and explain it in detail. node. js entry-level
After thinking for a long time, I always want to write something that is helpful to everyone. Today I will explain how to generate a project.
At present, the market generally requires a full stack of people ----- mean (mongo, express, angula
Analyzes the callback and code design modes in Node. js asynchronous programming, and node. js design modes
The biggest selling point of NodeJS is the event mechanism and asynchronous IO, which is not transparent to developers. Developers need to write code in asynchronous mode
(200,{'Content-Type': 'text/html'}); res.write('Node. js
'); res.end('hello world ');}).listen(3000);console.log("http server is listening at port 3000.");
Run
$ node app.js
Open the browser and open http: // 127.0.0.1: 3000 to view the result.
This program calls the http Module provided by node.
operating system installation file (install the latest version)
Follow the prompts to go to the next step until the installation is successful. You can see (C: \ Program Files \ nodejs) in the default installation path. The default path can be modified during installation.
After the installation is successful, enter "node-v" in the "command prompt" to view the installation version. The installation is successful if the version is output.
NPM Introduc
. node-gyp \ 0.10.33 directory does not have the default Debug directory. When compiled into the debug file in vs2013, the error LNK1104: cannot open file 'C: \ Users \ Administrator is displayed. node-gyp \ 0.10.33 \ Debug \ node
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
Quickly learn how to install and run the Node. js environment and the node. js Environment
InstallerNodeJS provides some installation programs that can be downloaded and installed at nodejs.org.
In Windows, select an installation file with the. msi suffix that matches the system version. In Mac OS X, select the install
Node. js has to say 12 points. node. js has to say
1. node. js: javascript on the server side. It allows javascript code to be run on the backend (out of the browser environment.
2. event-driven, asynchronous I/O programming
This article mainly introduces Node. callback and code design patterns in js asynchronous programming. Although long string parentheses during callback writing are not very nice in most cases, Node's asynchronous performance is indeed good, for more information, see the event mechanism and asynchronous IO, the biggest selling point of NodeJS, which is not transparent to developers. Developers need to write
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.