温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/fs/symlink
点击访问原文链接

Node fs.symlink function | API Reference | Bun

Node fs.symlink function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:fs/symlinkNsymlink

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:fs/symlinkNsymlink

namespace

fs.symlink ./mew ```" data-algolia-static="false" data-algolia-merged="true" data-type="Namespace">function symlink(target: PathLike,path: PathLike,type?: null | Type,callback: NoParamCallback): void;

Creates the link called path pointing to target. No arguments other than a possible exception are given to the completion callback.

See the POSIX symlink(2) documentation for more details.

The type argument is only available on Windows and ignored on other platforms. It can be set to 'dir', 'file', or 'junction'. If the type argument is not a string, Node.js will autodetect target type and use 'file' or 'dir'. If the target does not exist, 'file' will be used. Windows junction points require the destination path to be absolute. When using 'junction', thetarget argument will automatically be normalized to absolute path. Junction points on NTFS volumes can only point to directories.

Relative targets are relative to the link's parent directory.

import { symlink } from 'node:fs';

symlink('./mew', './mewtwo', callback);

The above example creates a symbolic link mewtwo which points to mew in the same directory:

tree .
.
├── mew
└── mewtwo -> ./mew
function symlink(target: PathLike,path: PathLike,callback: NoParamCallback): void;

Asynchronous symlink(2) - Create a new symbolic link to an existing file.

@param target

A path to an existing file. If a URL is provided, it must use the file: protocol.

@param path

A path to the new symlink. If a URL is provided, it must use the file: protocol.

namespace symlinktype Type = 'dir' | 'file' | 'junction'

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node fs.symlink function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for namespace node:fs.symlink | Bun