input-from-fetch
v0.5.5
Published
Bingo input that runs a network request.
Readme
npm i input-from-fetchimport { inputFromScript } from "input-from-fetch";
await take(inputFromScript, { command: "https://example.com" });Options
inputFromFetch defines two parameters:
resource(required): thestringorRequestto be passed tofetchoptions(optional): theRequestInitobject to be passed tofetch
It sends a request to the resource with Input Context fetch and returns either:
undefined: If theofflineflag is enabledError: If an error was caught running the fetchResponse: The awaited response fromfetch()
See create.bingo > Templates > Concepts > Inputs for more documentation on Inputs.
