Method Description:
Outputs the current call stack to the standard error stream.
Grammar:
Copy Code code as follows:
Console.trace (label)
Receive parameters:
Label
Example:
Copy Code code as follows:
Method Description:
Sync version of Fs.realpath ().
Grammar:
Copy Code code as follows:
Fs.realpathsync (path, [cache])
Because this method belongs to the FS module, it is necessary to introduce FS module (VAR fs= require
Method Description:
Modify the file name to change the path in which the file is stored.
Grammar:
Copy Code code as follows:
Fs.rename (OldPath, NewPath, [Callback (ERR)])
Because this method belongs to the FS module, it
Method Description:
Gets the file information (the symbolic link is not parsed).
Grammar:
Copy Code code as follows:
Fs.lstat (Path, [Callback (err, stats)])
Because this method belongs to the FS module, it is necessary
Copy Code code as follows:
var http=require ("http");
var server=http.createserver ();
Server.on ("Request", function (req,res) {5 console.log (req.url);
Res.end ();
});
Server.listen (1337, "127.0.0.1");
Such code can
Method Description:
Sync version of Fstat ().
method returns a stat array object that contains the following information: (The following information is the file information read in the case, not the default value)
Copy Code code as follows:
Method Description:
Sync version of Fs.readfile ().
Grammar:
Copy Code code as follows:
Fs.readfilesync (filename, [encoding])
Because this method belongs to the FS module, it is necessary to introduce FS module (VAR fs= require (
Method Description:
Read the contents of the file in an asynchronous fashion.
Without the top content encoding, the output will be in Buffer format, such as:
Grammar:
Copy Code code as follows:
Fs.readfile (filename, [encoding],
Method Description:
Create a hard link.
Grammar:
Copy Code code as follows:
Fs.link (Srcpath, Dstpath, [Callback (ERR)])
Because this method belongs to the FS module, it is necessary to introduce FS module (VAR fs=
Method Description:
File content interception operation.
Grammar:
Copy Code code as follows:
Fs.truncate (Path, Len, [Callback (ERR)])
Because this method belongs to the FS module, it is necessary to introduce FS module
Gets the last matched subexpression
untitled Hello world!
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Get all of the matching results:
untitled Hello
Method Description:
File content interception operation.
Grammar:
Copy Code code as follows:
Fs.ftruncate (FD, Len, [Callback (ERR)])
Because this method belongs to the FS module, it is necessary to introduce FS module
Method Description:
Writes data to a file asynchronously, and the original content is replaced if the file already exists.
Grammar:
Copy Code code as follows:
Fs.writefile (filename, data, [options], [Callback (ERR)])
Method Description:
Writes data to a file asynchronously, and the original content is replaced if the file already exists.
Grammar:
Copy Code code as follows:
Fs.writefile (filename, data, [options], [Callback (ERR)])
Let's start with the literacy. What is a regular expression of greed, what is greed? Or what is a matching priority classifier, and what is ignoring the precedence classifier?
Well, I don't know what the concept is, let's give an example.
Some
The comments are inside the code. Very detailed.
Only judged the IE Firefox Google because I did not install other browsers, so hehe. Of course, if you want to judge other browsers. The basic code is the same.
Copy Code code as follows:
.
Match any character except for line breaks
\w
Match letters, numbers, underscores, Chinese characters
\s
Match any white space character
\d
Matching numbers
^
Match character
Before the beginning of this chapter, I would like to introduce an example to show that this incomplete abnormal optimization is reasonable or unreasonable.
The direct amount of string in C # is optimized very thoroughly ... We should be welcome to
The code is as follows:
Copy Code code as follows:
var st= "A[b]c[d]e[f]g";
var reg =/\[\w\]/ig;
var S1 = st.replace (Reg, "");
var s2=[];
var arr;
while ((Arr=reg.exec (ST))!=null) S2.push (arr[0]);
alert (S1);
Alert
Method Description:
The method is the same as Console.error (). Look at the source to know, Console.error is actually directly call Console.warn's
Grammar:
Copy Code code as follows:
Console.warn ([data], [...])
Receive
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service