Scheduled task starter
No server needed: a script that does work on a timer and logs the result.
Open in editor Free. Runs in your browser, no sign-up.
Scheduled task
The code
Two files, exactly what you get in the editor.
// Scripts without a server run until they finish, or forever with a timer.
// Deployed, this checks the price every minute and logs it.
async function check() {
const response = await fetch('https://api.coinbase.com/v2/prices/BTC-USD/spot')
const { data } = (await response.json()) as { data: { amount: string } }
console.log(`${new Date().toISOString()} BTC ${Number(data.amount).toLocaleString('en', { style: 'currency', currency: 'USD' })}`)
}
await check()
setInterval(check, 60_000)
Questions
Can I run Scheduled task in the browser?
Yes. Press Run and the program runs in a Node.js-compatible runtime, compiled to WebAssembly, right in your browser tab. npm packages install in the browser too.
How do I start a Scheduled task project online?
Click Open in editor. jsdrop copies this starter into a new drop with index.ts and package.json. Press Run to start it, and edit as you go.
Can other people reach my server?
Yes. When the program calls listen(), the preview shows the server and a public tunnel URL that works while your tab runs it. With Pro, deploy the drop to run around the clock at its own address.
Is it free?
Yes. Public drops, running in the browser, live collaboration, versions, and embeds are free, and you do not need an account to start.