在node.js中递归复制文件夹 [英] Copy folder recursively in node.js
本文介绍了在node.js中递归复制文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有更简单的方法来复制文件夹及其所有内容,而无需手动执行一系列 fs.readir
, fs.readfile
, fs.writefile
递归?
Is there an easier way to copy a folder and all its content without manually doing a sequence of fs.readir
, fs.readfile
, fs.writefile
recursively ?
只是想知道我是否错过了一个函数理想情况下这样工作
Just wondering if i'm missing a function which would ideally work like this
fs.copy("/path/to/source/folder","/path/to/destination/folder");
推荐答案
您可以使用 ncp 模块。我认为这就是你所需要的
You can use ncp module. I think this is what you need
这篇关于在node.js中递归复制文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文