node-getpass icon indicating copy to clipboard operation
node-getpass copied to clipboard

Please add a promise returning function to the API.

Open HenriGEIST opened this issue 4 months ago • 0 comments

Hello ! Thanks for your very useful lib.

I would like to have directly in your API an async function returning a promise like :

async function asyncGetPass (opts)
{
    function get_passphrase (resolve, reject)
    {
        function on_passphrase (error, password)
        {
            if (error) { reject  (error);    }
            else       { resolve (password); }
        }

        getPass (opts, on_passphrase);
    }

    return new Promise (get_passphrase)
}

Then I will not need to add this anymore in all my scripts.

Best regards.

HenriGEIST avatar Oct 23 '24 08:10 HenriGEIST