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

Add trash.sync() #73

Open
Enteleform opened this issue May 26, 2018 · 5 comments
Open

Add trash.sync() #73

Enteleform opened this issue May 26, 2018 · 5 comments

Comments

@Enteleform
Copy link

Please consider adding trash.sync() as a synchronous option.

It would be convenient for users of fs-extra to pair its sync/async functions appropriately with trash.

@sindresorhus sindresorhus changed the title trash.sync() ? Add trash.sync() Feb 15, 2019
@sindresorhus
Copy link
Owner

sindresorhus commented Feb 15, 2019

The trash operation can be slow, so it would not be recommended for anything other than scripts or CLIs. PR welcome.

@Pomax
Copy link

Pomax commented May 14, 2019

Late to the party, but remember that await is supported by lots of things, including Node.js, so if you need trash.sync: already covered by Javascript itself (thanks to trash returning a promise)

@dhanyn10
Copy link

dhanyn10 commented May 16, 2021

Late to the party, but remember that await is supported by lots of things, including Node.js, so if you need trash.sync: already covered by Javascript itself (thanks to trash returning a promise)

@Pomax sorry but i dont understand yet. how do javascript cover trash.sync by promise?

@dhanyn10
Copy link

@Pomax wait, did you mean this?

async function doMyThings() {
  // do some things...

  // ... then sync trash, but wait for that to finish before doing more things...
  await trash('myfiles');

  // ... and then do more things once trash has finished.
}

trash.sync() not available yet, as mentioned from this issue title

@Pomax
Copy link

Pomax commented May 19, 2021

sorry, was thinking of something else: the current README.md already covers exactly what I wrote about 2 years ago: https://github.com/sindresorhus/trash#usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants