Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(nodejs)!: Remove append api #4796

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading