async function readFileContents(path) {
await using disposer = new AsyncDisposableStack();
const handle = disposer.use(await fs.open(path));
const data = await handle.read();
return data;
// The disposer is disposed here, which causes handle to be closed too
}AsyncDisposableStack.prototype.use() / notebook
AsyncDisposableStack.prototype.use()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.