neverstew
This Val URL
Returns the URL of the val that calls this function.
View source code
Just like a right click + inspect on desktop, except available on mobile too! Just write the website after the /
e.g.
https://neverstew-viewSource.web.val.run/bbc.co.uk
Generate QR codes
Generate a QR code for any link instantly!
Example
https://neverstew-generateQR.web.val.run?url=https://neverstew.com
This val allows you to send me an email at a certain datetime. Fun!
List things in a blob directory
Blobs can be organised using "directories" e.g.
/animals
all-animals.txt
/dogs
sausage.txt
/cats
tom.txt
is really only three files: /animals/all-animals.txt
, /animals/dogs/sausage.txt
and /animals/cats/tom.txt
because directories don't really exist, we're just making longer filenames.
When you want to list things only "in a directory" and none of the child "directories", you can use this val.
Create valimport { blobDirList } from "https://esm.town/v/neverstew/blobDirList";
console.log(await blobDirList("/animals"));
// returns only "/animals/all-animals.txt"
inTheBackground
With the addition of the "early return" feature of web handlers, you can now process short background tasks in vals. This can be really useful for occasions where an immediate response is required, with a subsequent update a few seconds later
e.g. a Discord bot that calls ChatGPT needs to respond within a few seconds, which can be too fast for the AI to generate a response. We can instead reply immediately and then update that message later, inTheBackground
Simply wrap something in inTheBackground
and it will do just that! In this example, we log something a few seconds later than the web response is sent back.