Glob files and copy/symlink/hardlink in another directory.
import { shadow } from "@seangenabe/shadow"
Globs the current directory (opts.cwd || process.cwd()
) and copies, symlinks, or hardlinks the globbed files with the globbed folder structure into dest.
Parameters:
- pattern - array | string - One or more glob patterns to select the files to link
- dest - the destination directory
- opts - options to pass to
globby
- copyMode -
'symlink' | 'link'
- Symlink or hardlink the files. If unspecified, will simply copy the files. - fallback - Fall back to copying if there aren't enough permissions to symlink or hardlink (
EPERM
).
- copyMode -
Returns a promise that resolves when all files have been hardlinked.
shadow <cwd> <dest> [pattern = **]
Options:
- cwd, dest, pattern - same as above
- -m --mode - symlink or hardlink the file
- -f --fallback - fall back to copying the file on EPERM
This package is modified from hardlink
's code and is a superset of its functionality.
MIT