hardlink
Glob files and create hardlinks in another directory.
Usage
const hardlink =
hardlink(pattern, dest, opts)
Globs the current directory (opts.cwd || process.cwd()
) and 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
Returns a promise that resolves when all files have been hardlinked.
CLI
hardlink <cwd> <dest> [pattern = **]
Use case
You might have an output directory that might contain files from a source directory. In that case, a symbolic link or junction to the source directory might be desirable. But if you want to mix and match files from other sources into the output directory, you won't be able to use those. A hardlink for each file might be useful for this case.
Related
License
MIT