2.2.1 • Published 3 years ago

@as2network/file-copier v2.2.1

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 years ago

File Copier

Overview

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

Usage

import { FileCopier } from '@zoltu/file-copier'
import * as path from 'path'
const inputDirectoryPath = path.join(__dirname, 'source')
const outputDirectoryPath = path.join(__dirname, 'output')
const filterFunction = (filePath: string) => !filePath.endsWith('.md')

new FileCopier(inputDirectoryPath, outputDirectoryPath, filterFunction)