// Name: DeepL// Author: Jacob Cofman// Twitter: @jcofman// Description: Translates text using https://www.deepl.com/translatorimport "@johnlindquist/kit"let DEEPL_AUTH_KEY = await env("DEEPL_AUTH_KEY", {hint: md(`Get a [DeepL API Key](https://www.deepl.com/docs-api/accessing-the-api/)`),ignoreBlur: true,secret: true,})let text = await getSelectedText();let targetLanguage = await arg("Select a traget Language e.g: DE or EN")let response = await post(`https://api-free.deepl.com/v2/translate?auth_key=${DEEPL_AUTH_KEY}&text=${text}&target_lang=${targetLanguage}`)setSelectedText(response.data.translations[0].text)
// Menu: Fake// Description: generate fake data with faker.js// Author: Jacob Cofman// Twitter: @jcofmanimport "@johnlindquist/kit"const {faker} = await npm("@faker-js/faker");function getMethodFakerData(method) {return Object.keys(faker[method]);}const fakerMethods = ["name","address","phone","internet","company","image","lorem","helpers","date","random","finance","hacker","system","commerce","database","animal","git","music","datatype",];const method = await arg("Select-Base-Method:", fakerMethods);const fakerBaseMethods = getMethodFakerData(method);const script = await arg("Select-Script:", fakerBaseMethods);const result = await faker[method][script]();copy(result);await arg(result);