(
path: string,
data: string,
options?: { mode?: 'w' | 'a'; encoding?: BufferEncoding },
)
| 750 | } |
| 751 | |
| 752 | async writeText( |
| 753 | path: string, |
| 754 | data: string, |
| 755 | options?: { mode?: 'w' | 'a'; encoding?: BufferEncoding }, |
| 756 | ): Promise<number> { |
| 757 | const resolved = this._resolvePath(path); |
| 758 | const mode = options?.mode ?? 'w'; |
| 759 | const encoding = options?.encoding ?? 'utf-8'; |
| 760 | const buf = Buffer.from(data, encoding); |
| 761 | if (mode === 'a') { |
| 762 | await sftpAppendFile(this._sftp, resolved, buf); |
| 763 | } else { |
| 764 | await sftpWriteFile(this._sftp, resolved, buf); |
| 765 | } |
| 766 | return data.length; |
| 767 | } |
| 768 | |
| 769 | async mkdir(path: string, options?: { parents?: boolean; existOk?: boolean }): Promise<void> { |
| 770 | const resolved = this._resolvePath(path); |
nothing calls this directly
no test coverage detected