trashItem

abstract fun trashItem(path: String): Promise<Void>(source)

Resolves when the operation has been completed. Rejects if there was an error while deleting the requested item.

This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin on Windows, and a desktop-environment-specific location on Linux).

The path must use the default path separator for the platform (backslash on Windows). Use path.resolve() from the node:path module to ensure correct handling on all filesystems.