“node js delete folder” Kode Jawaban

Hapus Dir Nodejs

fs.rmdirSync(dir, { recursive: true });
Bloody Boar

node js delete folder dengan file

const fs = require('fs');

// directory path
const dir = 'temp';

// delete directory recursively
try {
    fs.rmdirSync(dir, { recursive: true });

    console.log(`${dir} is deleted!`);
} catch (err) {
    console.error(`Error while deleting ${dir}.`);
}
Faiz

folder hapus simpul fs

const fs = require('fs');

fs.rmSync(folderPath, { recursive: true })
florinrelea

NodeJS fs menghapus direktori non kosong

var rimraf = require("rimraf");
rimraf("/some/directory", function () { console.log("done"); });
Repulsive Rattlesnake

cara menghapus folder menggunakan node js

fs.unlink('./node/myText.txt',function(){
    fs.rmdir('node');
});
Alive Addax

node js delete folder

const fs = require('fs');
fs.rmSync('./folder-to-be-deleted', { recursive: true });
Bloody Boar

Jawaban yang mirip dengan “node js delete folder”

Pertanyaan yang mirip dengan “node js delete folder”

Lebih banyak jawaban terkait untuk “node js delete folder” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya