mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 21:54:48 +00:00
feat(cli): Add WriteFileOptions to writeTextFile & writeTextFileSync (#6280)
This commit is contained in:
parent
82aabb657a
commit
231899695d
3 changed files with 129 additions and 20 deletions
9
cli/js/lib.deno.ns.d.ts
vendored
9
cli/js/lib.deno.ns.d.ts
vendored
|
@ -1524,7 +1524,11 @@ declare namespace Deno {
|
|||
*
|
||||
* Requires `allow-write` permission, and `allow-read` if `options.create` is `false`.
|
||||
*/
|
||||
export function writeTextFileSync(path: string | URL, data: string): void;
|
||||
export function writeTextFileSync(
|
||||
path: string | URL,
|
||||
data: string,
|
||||
options?: WriteFileOptions
|
||||
): void;
|
||||
|
||||
/** Asynchronously write string `data` to the given `path`, by default creating a new file if needed,
|
||||
* else overwriting.
|
||||
|
@ -1537,7 +1541,8 @@ declare namespace Deno {
|
|||
*/
|
||||
export function writeTextFile(
|
||||
path: string | URL,
|
||||
data: string
|
||||
data: string,
|
||||
options?: WriteFileOptions
|
||||
): Promise<void>;
|
||||
|
||||
/** Synchronously truncates or extends the specified file, to reach the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue