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

x/libpkgx/mod.ts>Path#mv

bringing the entire open source ecosystem to your node and deno apps
Very Popular
Go to Latest
method Path.prototype.mv
Re-export
import { Path } from "https://deno.land/x/libpkgx@v0.15.2/mod.ts";

Moves a file.

    Path.root.join("bar").mv({to: Path.home.join("foo")})
    // => Path("/Users/mxcl/foo")

- Parameter to: Destination filename.
- Parameter into: Destination directory (you get `into/${this.basename()`)
- Parameter overwrite: If true overwrites any entry that already exists at the destination.
- Returns: `to` to allow chaining.
- Note: `force` will still throw if `to` is a directory.
- Note: Throws if `overwrite` is `false` yet `to` isalready* identical to
  `self` because even thoughour policy* is to noop if the desired
  end result preexists, checking for this condition is too expensive a
  trade-off.

Parameters

unnamed 0: { to: Path; force?: boolean; } | { into: Path; force?: boolean; }