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

Only extract specific file(s) #92

Closed
justin-dx opened this issue Feb 24, 2021 · 2 comments
Closed

Only extract specific file(s) #92

justin-dx opened this issue Feb 24, 2021 · 2 comments
Labels

Comments

@justin-dx
Copy link

How can I extract only specific files?
The command line switches using just 7z is 7z e [archive.zip] -o [outputdir] [fileFilter]

const extractStream = extractFull('./archive.7z', './tmp/', {
    password: password,
    $bin: pathTo7zip,
    //$raw: ['-o./tmp/', 'x.jpg']
    //outputDir: `${outputFolderPath} x.jpg`
});

I've tried the above, but the extract does all files instead of just x.jpg.

@adamflorizone
Copy link

adamflorizone commented Feb 25, 2021

Try This:

const Seven = require('node-7z');

const myStream = Seven.extract('./test.7z', 'folder to extract to', {
	$cherryPick: ['*.txt*', '*.js'], // The file that you want
});

@justin-dx
Copy link
Author

Thanks @adamflorizone that worked 👍

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

No branches or pull requests

3 participants