Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/levo/lib/lib.deno_runtime.d.ts>Deno.close

Server side rendering with The Elm Architecture in Deno
Latest
function Deno.close
import { Deno } from "https://deno.land/x/levo@v0.0.27/lib/lib.deno_runtime.d.ts";
const { close } = Deno;

Close the given resource ID (rid) which has been previously opened, such as via opening or creating a file. Closing a file when you are finished with it is important to avoid leaking resources.

const file = await Deno.open("my_file.txt");
// do work with "file" object
Deno.close(file.rid);

Parameters

rid: number