I've been working with the archiverjs
node module and it works great. I'd now like to use a glob match to determine which files to zip but I also want to set the destination path in the zip just like you can with the destPath
option in the directory method. I'm wondering if there's an option or something that will accomplish this.
Asked
Active
Viewed 145 times
1

danseethaler
- 881
- 3
- 11
- 22
1 Answers
0
Seemed no one try to answer this question for a long time.
I confronted the same problem when using the archiver node module. I wanted to append files from a glob pattern and also set the destination path for them instead of the root directory.
Then I found an issue on archiver github #229 . Surprisingly, the prefix option cleared my problem.
archive.glob('file*.txt', {cwd: source_dir}, {prefix: destination_dir});
Hope it could help someone.
Best regards,

TungBN
- 1