mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
1b6f831875
Following JS ops were moved to separate files in cli/js/ops directory: - compiler - dispatch_json - dispatch_minimal - errors - fetch - fs_events - os - random - repl - resources - runtime_compiler - runtime - tty
20 lines
693 B
TypeScript
20 lines
693 B
TypeScript
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
|
import { sendSync, sendAsync } from "./ops/dispatch_json.ts";
|
|
|
|
/** Returns the destination of the named symbolic link.
|
|
*
|
|
* const targetPath = Deno.readlinkSync("symlink/path");
|
|
*
|
|
* Requires `allow-read` permission. */
|
|
export function readlinkSync(path: string): string {
|
|
return sendSync("op_read_link", { path });
|
|
}
|
|
|
|
/** Resolves to the destination of the named symbolic link.
|
|
*
|
|
* const targetPath = await Deno.readlink("symlink/path");
|
|
*
|
|
* Requires `allow-read` permission. */
|
|
export async function readlink(path: string): Promise<string> {
|
|
return await sendAsync("op_read_link", { path });
|
|
}
|