summaryrefslogtreecommitdiff
path: root/cli/js/ops/fs/rename.ts
blob: f0789d3ebbcd99da6658c0fb3113d4d28a0cd0d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.

import { sendSync, sendAsync } from "../dispatch_json.ts";

export function renameSync(oldpath: string, newpath: string): void {
  sendSync("op_rename", { oldpath, newpath });
}

export async function rename(oldpath: string, newpath: string): Promise<void> {
  await sendAsync("op_rename", { oldpath, newpath });
}