Guest User

Untitled

a guest
Dec 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. const fs = require("fs-extra");
  2.  
  3. console.log("*** start ***");
  4.  
  5. fs
  6. .copy("./src", "./dist", {
  7. filter: path => {
  8. // console.log("path ===", path);
  9. // skip filter on files
  10. if (fs.lstatSync(path).isFile()) return true;
  11. // return false if path is directory and string contains node_modules
  12. return !(path.indexOf("node_modules") > -1);
  13. }
  14. })
  15. .then(() => {
  16. console.log("folder copied successfully!");
  17. console.log("*** end ***");
  18. });
Add Comment
Please, Sign In to add comment