Skip to content

Commit

Permalink
refactor(nodejs)!: Remove append api (#4796)
Browse files Browse the repository at this point in the history
refactor(nodejs): remove `append` API
  • Loading branch information
bxb100 authored Jun 24, 2024
1 parent 591d034 commit 363ba6d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
16 changes: 0 additions & 16 deletions bindings/nodejs/generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,22 +353,6 @@ export class Operator {
* ```
*/
writeSync(path: string, content: Buffer | string, options?: WriteOptions | undefined | null): void
/**
* Append bytes into path.
*
* ### Notes
*
* - It always appends content to the end of the file.
* - It will create file if the path not exists.
*
* ### Example
* ```javascript
* await op.append("path/to/file", Buffer.from("hello world"));
* // or
* await op.append("path/to/file", "hello world");
* ```
*/
append(path: string, content: Buffer | string): Promise<void>
/**
* Copy file according to given `from` and `to` path.
*
Expand Down
26 changes: 0 additions & 26 deletions bindings/nodejs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,32 +371,6 @@ impl Operator {
writer.call().map_err(format_napi_error)
}

/// Append bytes into path.
///
/// ### Notes
///
/// - It always appends content to the end of the file.
/// - It will create file if the path not exists.
///
/// ### Example
/// ```javascript
/// await op.append("path/to/file", Buffer.from("hello world"));
/// // or
/// await op.append("path/to/file", "hello world");
/// ```
#[napi]
pub async fn append(&self, path: String, content: Either<Buffer, String>) -> Result<()> {
self.write(
path,
content,
Some(WriteOptions {
append: Some(true),
..Default::default()
}),
)
.await
}

/// Copy file according to given `from` and `to` path.
///
/// ### Example
Expand Down

0 comments on commit 363ba6d

Please sign in to comment.