summaryrefslogtreecommitdiff
path: root/cli/js/ops/fs/rename.ts
blob: 9f02c8bc0611f6218512cbfde094ffa2a41d42fd (plain)
1
2
3
4
5
6
7
8
9
10
// 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 });
}