move stuff to src folder, clarify readme

This commit is contained in:
ewin 2025-03-27 11:10:31 -04:00
parent 8497814fa4
commit 76d0d18e9f
Signed by: erin
SSH key fingerprint: SHA256:swjoHhREbZPbWe+gyJNi24d4NAxJSyUIm3fpZj4z3wc
5 changed files with 1 additions and 1 deletions

View file

@ -1,20 +0,0 @@
// misc helpers
import {execSync} from 'node:child_process';
/**
* terrible terrible terrible string diff helper for debugging
* @param {string} a
* @param {string} b
*/
export function diff (a, b) {
// base64 input strings before passing to shell to avoid escaping issues
// https://stackoverflow.com/a/60221847
// also use `|| true` to not throw an error when `diff` returns non-zero
execSync(`bash -c '
diff --color -u <(echo ${btoa(a)} | base64 -d) <(echo ${btoa(b)} | base64 -d)
' || true`, {
// display result directly in terminal
stdio: 'inherit',
});
}