Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Custom filenames in archive #317

Closed
psi-4ward opened this issue May 7, 2022 · 4 comments
Closed

[FEATURE] Custom filenames in archive #317

psi-4ward opened this issue May 7, 2022 · 4 comments
Labels
Enhancement new feature or improvement

Comments

@psi-4ward
Copy link

What / Why

I've lot's of <some-tmp-filename> files which maps to a human-readable filename in a database so I want to rename the file inside the archive.

Something like

tar.create( gzip: true }, [
  new PackJob('my_dog.jpg', path.resolve('ada9dj0j091j2e')),
  new PackJob('water-picture.jpg', path.resolve('pl9sn47fhbf')),
])

Or is this already possible? Looks like the API is too restrieced.

@psi-4ward
Copy link
Author

used tar-stream for now: mafintosh/tar-stream#24 (comment)

@darcyclarke darcyclarke added the Enhancement new feature or improvement label Jul 28, 2022
@isaacs
Copy link
Owner

isaacs commented Jun 19, 2024

You can do this as of 7.3 by modifying the entry in an options.onWriteEntry method.

@isaacs isaacs closed this as completed Jun 19, 2024
@exotexot
Copy link

There is no documentation on how to use the options.onWriteEntry method...

@isaacs
Copy link
Owner

isaacs commented Aug 14, 2024

Oh, that's a good point. Added some docs on 02f883a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement new feature or improvement
Projects
None yet
Development

No branches or pull requests

4 participants