Bun

Bun — A fast all-in-one JavaScript runtime

Setup

  "scripts": {
    "dev": "bun run src/index.ts"
  },

Fetch

const url = "..."
const response = await fetch(url, {
  method: "GET",
});
 
const results = await response.json();

File utils

await Bun.write(path, result);

Get dir where script is run:

import { $ } from "bun";
const getDir = async () => (await $`pwd`.text()).trim();