Skip to main content
Module

x/libpkgx/mod.ts>Path#mv

`import`… but with pkging powers
Extremely Popular
Latest
method Path.prototype.mv
Re-export
import { Path } from "https://deno.land/x/libpkgx@v0.18.1/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; }