mirror of
https://github.com/denoland/deno.git
synced 2025-10-01 06:31:15 +00:00
reorg: move JS ops implementations to cli/js/ops/, part 3 (#4302)
Following JS ops were moved to separate files in cli/js/ops directory: - net - tls - fs
This commit is contained in:
parent
2115b38fef
commit
b7eb241c35
30 changed files with 369 additions and 193 deletions
20
cli/js/ops/fs/read_link.ts
Normal file
20
cli/js/ops/fs/read_link.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { sendSync, sendAsync } from "../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 });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue