File tree Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -804,6 +804,38 @@ Asynchronously reads the entire contents of a file.
804804
805805***
806806
807+ ### rename()
808+
809+ > **rename**(`oldPath`: `string`, `newPath`: `string`): `Promise`\< `void`\>
810+
811+ Asynchronously renames a file or directory from `oldPath` to `newPath`.
812+
813+ ```js
814+ import { rename } from ' fs/ promises' ;
815+
816+ try {
817+ await rename(' oldfile .txt ' , ' newfile .txt ' );
818+ console.log(' Rename complete! ' );
819+ } catch (err) {
820+ console.error(err);
821+ }
822+ ```
823+
824+ #### Parameters
825+
826+ | Parameter | Type | Description |
827+ | ------ | ------ | ------ |
828+ | `oldPath` | `string` | A path to a file or directory. |
829+ | `newPath` | `string` | The new path for the file or directory. |
830+
831+ #### Returns
832+
833+ `Promise`\< `void`\>
834+
835+ Fulfills with `undefined` upon success.
836+
837+ ***
838+
807839### rm()
808840
809841> **rm**(`path`: `string`, `options`?: [`RmOptions`](../index.md#rmoptions)): `Promise`\< `void`\>
Original file line number Diff line number Diff line change @@ -860,6 +860,28 @@ Synchronously reads the entire contents of a file.
860860
861861***
862862
863+ ### renameSync()
864+
865+ > ** renameSync** (` oldPath ` : ` string ` , ` newPath ` : ` string ` ): ` void `
866+
867+ Synchronously renames a file or directory from ` oldPath ` to ` newPath ` .
868+
869+ For detailed information, see the documentation of the asynchronous version of
870+ this API: [ promises.rename] ( fs/promises.md#rename ) .
871+
872+ #### Parameters
873+
874+ | Parameter | Type |
875+ | ------ | ------ |
876+ | ` oldPath ` | ` string ` |
877+ | ` newPath ` | ` string ` |
878+
879+ #### Returns
880+
881+ ` void `
882+
883+ ***
884+
863885### rmdirSync()
864886
865887> ** rmdirSync** (` path ` : ` string ` , ` options ` ?: [ ` RmDirOptions ` ] ( index.md#rmdiroptions ) ): ` void `
Original file line number Diff line number Diff line change @@ -2123,6 +2123,14 @@ The name of the project.
21232123
21242124` string `
21252125
2126+ ##### getPath()
2127+
2128+ The directory where the project is located.
2129+
2130+ ###### Returns
2131+
2132+ ` string `
2133+
21262134##### getStatus()
21272135
21282136The status of the project.
Original file line number Diff line number Diff line change @@ -1975,6 +1975,14 @@ The name of the project.
19751975
19761976` string `
19771977
1978+ ##### getPath()
1979+
1980+ The directory where the project is located.
1981+
1982+ ###### Returns
1983+
1984+ ` string `
1985+
19781986##### getStatus()
19791987
19801988The status of the project.
You can’t perform that action at this time.
0 commit comments