@as2network/file-copier
v2.2.1
Published
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.
Downloads
4
Readme
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)