import { readFile } from 'node:fs/promises'; const [, , resource, filename] = process.argv; if (!resource || !filename) { console.error('usage: node clip-post.mjs '); process.exit(1); } const data = await readFile(filename); const res = await fetch(`http://localhost:3888/emit/${encodeURIComponent(resource)}`, { method: 'POST', body: data }); if (res.status !== 204) { console.error('POST failed:', res.status); process.exit(1); }