var util = require("util");
var fs = require("fs");
var unlink = util.promisify(fs.unlink);
async function f(fileNameArr) {
for(var i = 0; i < fileNameArr.length; i++){
await unlink(fileNameArr[i]);
}
}
//
f(["./1.txt", "2.txt", "3.txt"]);
First, I just console, I do not deal with. Second, the agreed rules...
Each SQLite function for synchronization, and can await interface. Note: You need SQLite for Node module and Node.js 8.0+, and support for async / await. SQLite most commonly used as a local storage u...
1. Callback function (Callback) 1. Concept 2. Example description Code description: Set a global variable A = 0, and then execute the WRITEFILE function (that is, write a file input01.txt). There is a...
Code example Example of the original author ...
Vue Async / AWAIT asynchronous example 1.async / await scene This is a scheme for synchronous thinking to solve the asynchronous problem, when the current end interface calls need to wait until the in...
1. Simple use of Async AWAIT / PROMISE; 2, other documents: JS prototype chain async await/promise...
The existing MD files are as follows: part1.md part2.md Fish encounter. Md Demand: Read the contents of the above three files and output. First, review how many files are implemented by reviewing how ...
Previous article has been introduced, usepromiseThe way of reading files, greatly reduces the useTune hellDifficulties. BelowasyncandawaitCombined with the read file instance, you can achieve the same...