1.0.1 • Published 4 years ago

p-syncy v1.0.1

Weekly downloads
26
License
MIT
Repository
github
Last release
4 years ago

p-syncy Travis CI Build Status

Resolve a promise synchronously.

NPM Badge

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.