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

x/dtils/fs.ts

The best unofficial library of utilities for Deno applications
Go to Latest
import * as dtils from "https://deno.land/x/dtils@2.6.0/fs.ts";

Functions

Copy the contents of srcDirectory into destDirectory, optionally filtering with options.pathFilter. Symlinks are ignored.

Create a watcher that monitors a list of files for updates

f
readBinary
deprecated

Read a file as a Uint8Array. Returns null if the file doesn't exist

Get all entries in dir. Resulting paths will not include dir. Symlinks are ignored.

Read a file, parsing it as json. Returns an empty object if the file doesn't exist or can't be parsed.

Read a file, parsing it as json. Returns an empty object if the file doesn't exist. Throws if the json can't be parsed.

Read a file as a string. Returns an empty string if the file doesn't exist.

Recursively read all files in rootDir. Resulting paths will include rootDir

Read the contents of directory into the returned map. Symlinks are ignored.

Recursively read all files in rootDir. Symlinks are ignored.

Write bytes to file. Creates the directory if it doesn't exist

Write json to file. Creates the directory if it doesn't exist

Write text to file. Creates the directory if it doesn't exist