From b5438207bf3be1f0c3e8dfbcba3469c3e9357c04 Mon Sep 17 00:00:00 2001 From: 5vl Date: Thu, 6 Apr 2023 21:25:41 +0200 Subject: [PATCH] Delete get_image.js --- get_image.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 get_image.js diff --git a/get_image.js b/get_image.js deleted file mode 100644 index 381ae05..0000000 --- a/get_image.js +++ /dev/null @@ -1,22 +0,0 @@ -// To use any npm package on Pipedream, just import it -import axios from "axios" -import Path from 'path' -import fs from 'fs' - -export default defineComponent({ - async run({ steps, $ }) { - let url = "" - await axios.get("https://api.thecatapi.com/v1/images/search?mime_types=jpg,png&api_key=API_KEY").then((res) => { - url = res.data[0].url - }) - const path = Path.resolve('/tmp', 'cat.jpg') - - const { data } = await axios({ - method: 'GET', - url, - responseType: 'arraybuffer', - }) - fs.writeFileSync(path, data) - return url - }, -})