Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/dts/lib.deno.ns.d.ts>Deno.FsFile#close

A modern runtime for JavaScript and TypeScript.
Go to Latest
method Deno.FsFile.prototype.close
import { Deno } from "https://deno.land/x/deno@v1.28.0/cli/dts/lib.deno.ns.d.ts";
const { FsFile } = Deno;

Close the 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
file.close();