nodejs copy files to another path. Mv and mvdir can look at npm library with one exception

const fs = require('fs')
mvdir const = The require ( 'mvdir' );
 // // public library file address 
the let sourcePath = './../store' ;
 // // you need to copy the location to 
let destPath = './src/store' ;
fs.exists(destPath, function(exists) {
  the console.log ( 'car is very stable' )
     IF (! EXISTS) {
    console.log ( 'I went to a public copy of the file' )
    mvdir(sourcePath, destPath, { copy: true });
  }else{
    console.log ( 'file is already in the public, do not panic' )
  };
});

 

Guess you like

Origin www.cnblogs.com/1rookie/p/12456699.html
Recommended