p-syncy
v1.0.1
Published
Resolve a promise synchronously.
Downloads
5
Maintainers
Readme
p-syncy
Resolve a promise synchronously.
Install
npm install p-syncy
Usage
const pSyncy = require("p-syncy");
const got = require("got");
const { body } = pSyncy(got("https://google.com"));
console.log(body)
//=> "<!doctype html>..."
const result = pSyncy(async () => {
return "Hello World!"
})
console.log(result)
//=> "Hello World!"
API
pSyncy(promise)
promise
Type: promise or function returning promise
The promise to resolve.