elm-pages-v3-beta/examples/pokedex/port-data-source.ts

25 lines
565 B
TypeScript
Raw Normal View History

import kleur from "kleur";
2022-07-06 01:56:48 +03:00
import something from './something.ts'
kleur.enabled = true;
export async function environmentVariable(name) {
const result = process.env[name];
if (result) {
return result;
} else {
throw `No environment variable called ${kleur
.yellow()
.underline(name)}\n\nAvailable:\n\n${Object.keys(process.env)
.slice(0, 5)
.join("\n")}`;
}
}
export async function hello(name) {
2022-07-06 01:56:48 +03:00
return `${something} 149 ${name}!!`;
}
function waitFor(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}