DO NOT COPY THIS CODE INTO PRODUCTION!
For this specific example, you should use packages like zx or bun shell which are battle-tested shell script runners for javascript environments
This is meant to showcase what a builder pattern for await operators can do.
// Does nothing
const myScript = $`ls -al`;
// Executes here
await myScript;await $`ls -al`;
await $`ls -al`.setEnv({ key: 'value' });
await $`cd ${'./folder name'}`;This works by creating a pseudo promise (called PromiseLike in Typescript) which creates a block of code that only executes when the developer calls await.