¿Hay alguna manera de copiar una estructura de carpetas sin copiar los archivos?
Sabía que podía copiar con fs-extra copy . Esta función puede copiar recursivamente, pero no encontré la manera de no copiar los archivos.
const fs = require("fs") const path = require("path") /** * Look ma, it's cp -R. * @param {string} src The path to the thing to copy. * @param {string} dest The path to the new copy. */ var copyRecursiveSync = function(src, dest) { var exists = fs.existsSync(src); var stats = exists && fs.statSync(src); var isDirectory = exists && stats.isDirectory(); if (isDirectory) { fs.mkdirSync(dest); fs.readdirSync(src).forEach(function(childItemName) { copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName)); }); } };