This article mainly introduces node. fs. mkdir method usage instructions. This article introduces fs. mkdir method description, syntax, receive parameters, use instances, and implement source code. For more information, see
Method description:
Create a file directory asynchronously. If the directory already exists, an exception is thrown.
Syntax:
The code is as follows:
Fs. mkdir (path, [mode], [callback (err)])
Because this method belongs to the
This article mainly introduces node. fs. lchown method usage instructions. This article introduces fs. lchown method description, syntax, receive parameters, use instances, and implement source code. For more information, see
Method description:
Change file ownership (do not parse symbolic links ).
Syntax:
The code is as follows:
Fs. lchown (path, uid, gid, [callback (err)])
Because this method belongs to the fs module, we need to introduce the fs
This article mainly introduces node. fs. fchmod method usage instructions. This article introduces fs. fchmod method description, syntax, receiving parameters, use instances and implementation source code. For more information, see
Method description:
Change the file permission (file descriptor ).
Syntax:
The code is as follows:
Fs. fchmod (fd, mode, [callback (err)])
Because this method belongs to the fs module, we need to introduce the fs module
This article mainly introduces node. fs. this document describes the usage of the readdir method. readdir method description, syntax, receive parameters, use instances, and implement Source Code. For more information, see
Method description:
Read the file directory asynchronously.
Syntax:
The Code is as follows:
Fs. readdir (path, [callback (err, files)])
Because this method belongs to the fs module, we need to introduce the fs module (var fs = re
This article mainly introduces node. fs. description of use of the rename method. This article introduces fs. rename method description, syntax, receive parameters, use instances and implementation source code. If you need this method, you can refer to the relevant information.
Method description:
Modify the file name to change the file storage path.
Syntax:
The Code is as follows:
Fs. rename (oldPath, newPath, [callback (err)])
Because this metho
This article mainly introduces node. fs. readdirSync method usage instructions. This article introduces fs. readdirSync method description, syntax, receive parameters, use instances, and implement Source Code. For more information, see
Method description:
The synchronous version of fs. readdir ().
The method returns an array object containing "names of all objects in the specified directory.
Syntax:
The Code is as follows:
Fs. readdirSync (
This article mainly introduces node. fs. statSync method usage instructions. This article introduces fs. statSync method description, syntax, receive parameters, use instances, and implement Source Code. For more information, see
Method description:
The stat () of the synchronous version ().
Method to return an stat array object that contains the following information: (The following information is the file information read in the case, not the defau
This article mainly introduces node. fs. the appendFile method is described in this article. appendFile method description, syntax, receive parameters, use instances, and implement source code. For more information, see
Method description:
This method inserts data into a file asynchronously. if the file does not exist, it is automatically created. Data can be any string or cache.
Syntax:
The code is as follows:
Fs. appendFile (filename, data, [opti
This article mainly introduces node. fs. readdirSync method usage instructions. This article introduces fs. readdirSync method description, syntax, receive parameters, use instances, and implement source code. For more information, see
Method description:
The synchronous version of fs. readdir ().
The method returns an array object containing "names of all objects in the specified directory.
Syntax:
The code is as follows:
Fs. readdirSync (
This article mainly introduces node. fs. mkdirSync method usage instructions. This article introduces fs. mkdirSync method description, syntax, receive parameters, use instances, and implement source code. For more information, see
Method description:
Synchronous version of fs. mkdir ().
Syntax:
The code is as follows:
Fs. mkdirSync (path, [mode])
Because this method belongs to the fs module, we need to introduce the fs module (var fs = r
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.
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
process terminated due to receipt of signal ${signal}`); }); // Send SIGHUP to process grep.kill('SIGHUP');
An error event is triggered when the ChildProcess object cannot transmit signals. Although an error cannot be reported when sending a signal to an exited sub-process, it may lead to unexpected results. In particular, if this PID has been assigned to another process, this will also lead to unexpected results.
Child. pid:
Returns the PID of the process.
Const spawn = require ('child _ Proce
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
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
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
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
triggered when the client-side connection is disconnected on the server.
Copy codeThe Code is as follows:Socket. on ("disconnect", funciton (){});
This callback function does not apply to any parameters.
Server. js code:
Copy codeThe Code is as follows:Var http = require ("http ");Var sio = require ("socket. io ");Var fs = require ("fs ");Var server = http. createServer (function (req, res ){Res. writehead( 200, {"Content-type": "text/html "});Res. e
be no overhead for the second request.
Native module loading:
After resolving the file name, The require () method first searches in the module cache, and then searches in the native module of node.Load from FileModule. path has a paths attribute when creating the module object for each loaded file module. The path points to the path of the introduced module.When the absolute path module is requested, it does not traverse node_module for the fastest loading speed.
Asynchronous programming
High-
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.