Skip to main content
Module

std/fs/mod.ts>moveSync

The Deno Standard Library
Latest
function moveSync
import { moveSync } from "https://deno.land/std@0.222.1/fs/mod.ts";

Synchronously moves a file or directory.

Examples

Basic usage

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

moveSync("./foo", "./bar");

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

Overwriting

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

moveSync("./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

void

A void value that returns once the operation completes.