How to Use stream in node. js: node. jsstream
I ran to learn OC in these days, but I haven't learned it yet. There is still a long time to leave the job. By the way, let's review the knowledge of node.
There are a lot of people coming and going in every language, but I can't do without
terminal, first in the terminal you want to see the log input:$ ttyYou can get the terminal number, for example:/dev/ttys003Then another terminal uses:$ geth console 2>> /dev/ttys003Start Geth, which is the log output to another terminal.If you do not want to see the log, you can redirect to an empty terminal:$ geth console 2>> /dev/nullLog level ControlYou can use --verbosity to control the log level, and
Turn from:Nine console commands to make JS debugging easierI. Commands to display information
123456789101112131415
"Content-Type" content="text/html; charset=utf-8"/>
The most common is the console.log.Two: PlaceholderConsole The above concentration supports printf placeholder format, supported placeholders are: characters (%s), integers (%d or%i), floating-point numbers (%f), and
Recently written program node. data storage is required for js programs. there are many databases that js can use, such as mongodb and MySQL. However, I still think these databases are too large to be useful, making them more troublesome. So I found node-tiny, a non-relational database, a bit similar to mongodb.Tiny's
Just read about the JS Blog when found that this method is very fun, I have a cool.1 When loaded, the console displays the following: Can see, different nature of the information in front of the different icons, and each message has a hyperlink behind, click to jump to the corresponding line of the source page.Second, placeholder You can use the printf-style placeholder for the top 5 methods of t
Introduction to the Node. js lightweight Web framework Express4.x User Guide, node. jsexpress4.x
Express is a lightweight Web framework that is simple and flexible
It is also the most popular Nodejs-based Web framework.
With this feature, we can quickly build a complete website (express)
Express is now in version 4.x, which is updated quickly and is not compatibl
(function (request, response) { response.writehead (200,{ ") Content-type ":" Text/plain " }); Response.Write (DoSomething ()); Response.End ();}). Listen (console.log); (' Server running at http://127.0.0.1:3000 '); function dosomething () { Then execute the Supervisor Hello_world.js. As shown, the console tells me that he is already monitoring my project.Then I changed the welcome speech.function dosomethi
Before writing a Node application, you must first learn the Node modules and packages. Modules and packages are the basic units of applications. A Node. js file is a module, which may be Javascript code, JSON, or compiled C/C ++ extensions.
var count=0;exports.next=function(){return count++;}
Instance:
var n
This article mainly introduces the node module mechanism and detailed information about asynchronous processing. For more information, see
1. Module Mechanism
The purpose of the commonJS module mechanism is to build an ecosystem of js in terms of web servers, desktop programs, and browsers. Node js is an implementati
to the location where the code is called.
Console.assert (expression[, Object, ...])
Tests whether an expression expression is true. If not true, a message is written at the console and an exception is thrown
Console.dir (object)
Outputting all the properties of an object in a list is a bit like the way you look at the Dom window.
Console.dirxml (node)
Output an XML source code for an HTML or XML ele
Three implementation methods for synchronous operations in node. js, node. js3
As we all know, Asynchronization is a unique feature and advantage, but it is also common to require synchronization in the Program (for example, the execution sequence of the control program is func1-> func2-> func3. This article records some of your thoughts on this issue.
Functions
node's handy tip--Compression codeDownload ImageCompress CodeI believe many front-end students will be on the line before the compression JS code, now Gulp Webpack Grunt ... can be easily achieved. But the problem comes, these will not, it is necessary to face dozens of JS files back and forth "copy-compress-Create-paste", this is too impersonal.It can be easily implemented with
Use pure Node. JS to pop up the Windows system message box instance (MessageBox), node. jsmessagebox
Node. JS is a console program. If you want to pop up a Windows Prompt box from Node.
Node. js mysql package instructions, node. jsmysql
Author: zhanhailiang Date: 2014.11.16
This article explains how to rely on the mysql package on the node. js platform to access mysql.
1. installation:
[root@~/wade/nodejs/nodebeginner/mysql_test]# npm install mysql
2. mysql
Example of Node. js readline Reading and Writing File Content line by line, node. jsreadline
This article describes the two implementation methods of reading data row by row using readline. The details are as follows:
What is Readline?
Readline is an encapsulated module for implementing standard input and output in Node
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
collection specifically in this case to find all female users. // app. jsdb. users. find ({sex: "female"}, function (err, users) {if (err |! Users) console. log ("No female users found"); else users. forEach (function (femaleUser) {console. log (femaleUser) ;}); Notice how our initial query is a near duplication of the corresponding query in MongoDB's console. i
The http. request Method in node. js is described in node. jsrequest.
Method description:
The function room acts as a client to initiate a request to the HTTP server.
Syntax:
Copy codeThe Code is as follows:Http. get (options, callback)
Because this method belongs to the http module, the http module (var http = require ("http") must be introduced before use "))
R
Description of the fs. read method in node. js, node. jsfs. read
Method description:
Reads file data based on the specified file descriptor fd and writes it to the buffer object pointed to by the buffer. Compared with readFile, it provides a more underlying interface.
Generally, this method is not recommended to read files because it requires you to manually mana
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.