Update the process about Release 0.4

 In the second blog of Release 0.4, I will update my process about my link check project.

Until now, my link check project can test status of a single link and the status of all the links of a file. But it can't process a directory to check all the files which include the links. So, I decide to add this feature to my project. I create an issue in the repo of Github.

During the studying of Javascript and C++ programming languages, I just know how to read a file. It is a new topic for me. So, I need to search for the resolution for reading a directory. After searching, I find that there are two ways to read a directory using JavaScript. One is "fs.readdir()". The other is "fs.readdirSync()". 

The fs.readdir() method is used to asynchronously read the contents of a given directory. The callback of this method returns an array of all the file names in the directory. The options argument can be used to change the format in which the files are returned from the method. The completed syntax is fs.readdir( path, options, callback ).The fs.readdirSync() method is used to synchronously read the contents of a given directory. The method returns an array with all the file names or objects in the directory. The options argument can be used to change the format in which the files are returned from the method. The completed syntax is fs.readdirSync( path, options).

The result of reading a directory can not be passed out of the scope of reading using syntax "fs.readdir()". It is not what I want. I want to use the result to further some test later. So, I plan to use "fs.readdirSync()".

Comments

Popular posts from this blog

Choose a project in Release 0.4

Open source development course

Publish project in Lab 9