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

Why did not into then #120

Open
jiucheng-front opened this issue Jul 6, 2022 · 1 comment
Open

Why did not into then #120

jiucheng-front opened this issue Jul 6, 2022 · 1 comment

Comments

@jiucheng-front
Copy link

On node-7z(0.2.0), As follows, why did not into then? It into catch, But add success
sevenZip.add('WJF001.zip', allLogPath).progress(function(res) {
console.log(res, '111');
}).then(function() {
console.log('222');
}).catch(function(err) {
console.log(err, '333');
});

@twok020101
Copy link

My understanding is, it's not async/await (promise) function. This library triggers events from childProcess which is then retrieved using 'on' method. Hence '.then' or '.catch' wont work, instead you can use

myStream.on('err',(err)=>{console.log(err)});
myStream.on('end',(res)=>{consoole.log('222'});

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

No branches or pull requests

2 participants