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

Support work in Promise way #24

Open
onikienko opened this issue Jan 6, 2021 · 2 comments
Open

Support work in Promise way #24

onikienko opened this issue Jan 6, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@onikienko
Copy link
Owner

No description provided.

@onikienko onikienko added the enhancement New feature or request label Jan 6, 2021
@onikienko onikienko self-assigned this Jan 6, 2021
@mattb290
Copy link

mattb290 commented Feb 6, 2021

support async/await

@onikienko onikienko added this to the v2.0.0 milestone Jul 12, 2021
@marios88
Copy link

A quick way to do it for now

function bzip(path,path_bz2) {
    return new Promise(function (fulfilled, rejected) {
        _7z.pack(path, path_bz2, function (err) {
            fulfilled(1);
        });
    });
}

async function run() {
    const path = 'file.txt';
    const path_bz2 = 'file.txt.bz2';
    await bzip(path,path_bz2);
}

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

No branches or pull requests

3 participants