Skip to content

Commit

Permalink
feat(hukkup): add hukkupAsync function
Browse files Browse the repository at this point in the history
It's easier to use async/await in else where
  • Loading branch information
nampdn authored Nov 30, 2018
1 parent 8e215ca commit 54511af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/hukkup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,15 @@ export const hukkup = (
req.write(body);
req.end();
};

export const hukkupAsync = (opts: HukkupOptions): Promise<any> => {
return new Promise((resolve, reject) => {
hukkup(opts, (err, res) => {
if (err) {
reject(err);
} else {
resolve(res);
}
});
});
}

0 comments on commit 54511af

Please sign in to comment.