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

x/ayonli_jsext/esm/fs.js>utimes

A JavaScript extension package for building strong and modern applications.
Latest
function utimes
import { utimes } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/fs.js";

Changes the access (atime) and modification (mtime) times of the file or directory. Given times are either in seconds (UNIX epoch time) or as Date objects.

NOTE: This function only works in Node.js, Deno and Bun, in other environments, it's a no-op.

Examples

Example 1

import { utimes } from "@ayonli/jsext/fs";

// Set the access and modification times to the current time.
await utimes("/path/to/file.txt", Date.now(), Date.now());

Parameters

path
atime
mtime