node.foldercopy

node-module, .\src\foldercopy.js

copies the specified folder

it does it recursively from the source-folder to destination-folder including all files

Functions
public recursiveCopy(folders, p, dest)

copies the specified folders

the function looks in the source folder for the dirs and copies them recursively to the destination

Parameter

folders

  • array

an array of folder names

p

  • array

an array of foldernames, that get concatinated using path.sep

dest

  • string

the destination folder

public copyFolder(base, folder, recurse, dest)

copies the specified folder

Parameter

base

  • string

the base folder where to look

folder

  • string

the name of the folder in "base" to copy

recurse

  • string

how deep we have iterated (it gets appended to dest)

dest

  • string

the destination folder

public copyFile(base, file, dest)

copies the specified file

Parameter

base

  • array

the base folder where to look

file

  • array

the name of the file in "base" to copy

dest

  • string

the destination folder

private iterator(arr, fneach, fnend)

iterates over an array

during iteration it calls fneach for each element and fnend when iteration is done

Parameter

arr

  • array

the array to iterate over

fneach

  • function

the function to call on each item

fnend

  • function

the function to call when iteration is done

Usage
 var fc = require('foldercopy');