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

Node fs.unlink function | API Reference | Bun

Node fs.unlink function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:fs/unlinkNunlink

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:fs/unlinkNunlink

namespace

fs.unlink { if (err) throw err; console.log('path/file.txt was deleted'); }); ``` `fs.unlink()` will not work on a directory, empty or otherwise. To remove a directory, use rmdir. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details." data-algolia-static="false" data-algolia-merged="true" data-type="Namespace">function unlink(path: PathLike,callback: NoParamCallback): void;

Asynchronously removes a file or symbolic link. No arguments other than a possible exception are given to the completion callback.

import { unlink } from 'node:fs';
// Assuming that 'path/file.txt' is a regular file.
unlink('path/file.txt', (err) => {
if (err) throw err;
console.log('path/file.txt was deleted');
});

fs.unlink() will not work on a directory, empty or otherwise. To remove a directory, use rmdir.

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

namespace unlink

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.unlink function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for namespace node:fs.unlink | Bun