$ diff -u a b
Diff Checker
// Paste or drop two versions of anything — code, config, prose — and see exactly what moved, down to the word. Nothing leaves the browser.
original
changed
+1 added−1 removed~4 changed8 unchanged6 differences
1
import { readFile } from "node:fs/promises";1import { readFile } from "node:fs/promises";2import { resolve } from "node:path";2
33
export async function loadConfig(path) {4export async function loadConfig(path) {4
const raw = await readFile(path, "utf8");5 const raw = await readFile(resolve(path), "utf8");5
const parsed = JSON.parse(raw);6 const config = JSON.parse(raw);6
77
if (!parsed.name) {8 if (!config.name) {8
throw new Error("config is missing a name");9 throw new Error("config is missing a name");9
}10 }10
1111
console.log("loaded", path);12
return parsed;12 return { ...config, path };13
}13}