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

std/fs/move.ts>move

The Deno Standard Library
Go to Latest
function move
import { move } from "https://deno.land/std@0.223.0/fs/move.ts";

Asynchronously moves a file or directory.

Examples

Basic usage

import { move } from "https://deno.land/std@0.223.0/fs/move.ts";

await move("./foo", "./bar");

This will move the file or directory at ./foo to ./bar without overwriting.

Overwriting

import { move } from "https://deno.land/std@0.223.0/fs/move.ts";

await move("./foo", "./bar", { overwrite: true });

This will move the file or directory at ./foo to ./bar, overwriting ./bar if it already exists.

Parameters

src: string | URL

The source file or directory as a string or URL.

dest: string | URL

The destination file or directory as a string or URL.

optional
unnamed 2: MoveOptions = [UNSUPPORTED]

Options for the move operation.

Returns

Promise<void>

A void promise that resolves once the operation completes.