At present, node. JS is very popular in front page development, it is a set of JavaScript toolkit to write high-performance Web server, in this article, will lead you beginners to introduce the basic knowledge of Node JS, This article is required to read for readers with certain JavaScript and other development languag
= Run environment + JavaScript library node. js attribute
The asynchronous and event-driven APIs of the node. JS Library are all asynchronous and non-blocking. It mainly refers to node. JS-based servers that do not wait
Broadcast messages of socket. io in node. js, node. jssocket. io
After multiple clients establish a connection with the server. the io () server has a sockets attribute. The attribute value is all socket objects connected to the client. you can use the send method or emit method of this object to broadcast messages to all clients.
Io. sockets. send ("user commect
10 comparison challenges between PHP and Node. js
In the recent SitePoint PHP vs Node. js Smackdown article, Craig Buckler compared the two languages to determine which one is better in terms of coping with a series of 10 challenges.
Craig mentioned in his book that these comparisons always have some contradictions. A
great for more than just blogs.8. PaperclipPaperclip.js is a powerful the template engine that's built for extensibility and speed. It creates compiled templates for the browser and node. js.9. SetSet is a unobtrusive, dry template engine for node.
Example of calling the mysql stored procedure in Node. js, node. jsmysql
The test passed only in windows, but not in linux. If you have any questions, please email me ~
1. Install node. js and mysql. Click here (search by yourself )...;
2. Create a database named test and cr
Detailed description of the use of client sessions in Node. js programming, node. jssession
Static websites are easy to expand. You only need to cache all the data and do not need to consider combining stateful content from different servers to users.
Unfortunately, most Web applications use stateful content to provide personalized experiences. If your applicatio
Amazing node. js Reading Notes: mongodb database interaction, node. jsmongodb
This week, I learned how to interact with nodejs databases and used the jade template to build a user-verified website. I encountered several problems.
1. mongodb version is too low
Npm ERR! Not compatible with your operating system or architecture: mongodb@0.9.9
0.9.9 only supports lin
('view engine ', 'jade ');
The above two rows set the views folder, that is, the template folder, __dirname is node. the global variable in js is the path of the js to be executed, and the _ filename is the currently executed js file name. Therefore,
difference is that the Mustache. render method has the third parameter.
Pre-compiled Template
Mustache. parse (template); // other code Mustache. render (template, view );
Templates have both advantages and disadvantages. It takes time to compile the template, so we can compile the template in advance if we know that a template will be used for later use.
I hope this article will help you learn more.
Articles you may be interested in:
Javascript lightweight template
This article describes how to use the ejs template and jade template in a node jsexpress framework project. For more information, see some projects, for example, if you take over a project from someone else and you don't want to use egg JS or jade. If you do not want to rewrite the previous page, you may need to introduce an ejs or jade module. You only need to perform the following two steps to use the two
Mysql Database Configuration and connection on the node. js platform, node. jsmysql
First download the mysql module package
Npm install mysql -- save-dev
Create a module for the database and put it in a file.
Var mysql = require ("mysql"); exports. connect = function (SQL, param, callback) {var db = mysql. createConnection ({host: "localhost", // Database URL
In order to improve the user experience, web applications often have a large amount of JavaScript. generally, some tools will be used to reduce the size of JS files before release, thus improving the download speed. every time you modify JS
CodeIt is very troublesome to use a client or online tool for processing and then upload it to the web server. austinchau provides a library that automatically compress
[ArticleAuthor: Sun Li link: http://www.cnblogs.com/sunli/ updated by:]
Today, I attended the Baidu technology Salon held by infoq, with the topic "App Engine Technology Application ". In the last two years, "cloud computing" and "virtualization" have heard a lot of things, but the technology sharing is really good. This time, the topic was very attractive. Due to the WiFi problem on the site, there was n
Heroku is a cloud platform that provides rapid deployment services. Support Node,ruby,java,php,python,go Multi-lingual, experience today, simply not too cool. Here's a quick introduction. First, or you want to register an account: Https://signup.heroku.com/login Do not know why, here 163 mailbox can not pass, QQ May. Then select Language node. js. After s
After each change to the node. JS project, we need to stop node. JS (shortcut key: Ctrl + C) and then run again with the command, which is especially troublesome. Here I recommend using the Supervisor Tool,The NPM installation command is:NPM install-g Supervisor.This way we start the
A deep understanding of the path module of node. js, node. jspath
Node path Module
// Reference this module var path = require ("path ");
1. parse the path to obtain the canonicalized path format.
// For the window system, the directories are separated into '\'. For UNIX systems, the separator is '/', '.. 'back to the
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.