Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fse moveSync vs copySync

// Does NOT delete files that exist in targetDir but do not exist in srcDir
fse.copySync(srcDir, targetDir, {overwrite: true});

// Does delete files that exist in targetDir but do not exist in srcDir
// Use if you want targetDir === srcDir
fse.moveSync(srcDir, targetDir, {overwrite: true});
 
PREVIOUS NEXT
Tagged: #fse #moveSync #copySync
ADD COMMENT
Topic
Name
3+9 =