Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Copier

Recursively copy/delete a folder in NodeJS, with the ability to filter certain files/folders along the way as well as get notified for each file/folder copied.

Usage

import { recursiveDirectoryCopy } from '@zoltu/file-copier'
import * as path from 'path'
const inputDirectoryPath = path.join(__dirname, 'source')
const outputDirectoryPath = path.join(__dirname, 'output')
const optionalFilter = async (filePath: string) => !filePath.endsWith('.md')
const optionalListener = async (sourcePath: string, destinationPath: string) => console.log(`${sourcePath} copied to ${destinationPath}`)

await recursiveDirectoryCopy(inputDirectoryPath, outputDirectoryPath, optionalFilter, optionalListener)

About

Watches a directory and ensures all files matching a predicate function are mirrored to another directory (recursively), and deletes the files from the mirror when they are deleted from the source.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages