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

Node fs.rename function | API Reference | Bun

Node fs.rename function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:fs/renameNrename

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:fs/renameNrename

namespace

fs.rename { if (err) throw err; console.log('Rename complete!'); }); ```" data-algolia-static="false" data-algolia-merged="true" data-type="Namespace">function rename(oldPath: PathLike,newPath: PathLike,callback: NoParamCallback): void;

Asynchronously rename file at oldPath to the pathname provided as newPath. In the case that newPath already exists, it will be overwritten. If there is a directory at newPath, an error will be raised instead. No arguments other than a possible exception are given to the completion callback.

See also: rename(2).

import { rename } from 'node:fs';

rename('oldFile.txt', 'newFile.txt', (err) => {
if (err) throw err;
console.log('Rename complete!');
});
namespace rename

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

    API documentation for namespace node:fs.rename | Bun