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

x/deno/cli/js/deno.ts>renameSync

A modern runtime for JavaScript and TypeScript.
Go to Latest
function renameSync
import { renameSync } from "https://deno.land/x/deno@v0.28.0/cli/js/deno.ts";

Synchronously renames (moves) oldpath to newpath. If newpath already exists and is not a directory, renameSync() replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories.

  Deno.renameSync("old/path", "new/path");

Parameters

oldpath: string
newpath: string