question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change all synchronous filesystem operations to use async methods

See original GitHub issue

writeFileSync to writeFile, etc.

We also need to make sure to always check for errors.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xPawcommented, Oct 9, 2016

FYI, eslint has a rule no-sync which we can use.

0reactions
xPawcommented, Mar 9, 2016

There’s not that many methods that would need changing: https://github.com/thelounge/lounge/search?utf8=✓&q=sync (unles GH search is missing some) Command line methods can stay synchronous, that’s not a problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing a synchronous method to async - Stack Overflow
The short answer is No, you cannot convert all types of synchronous code to asynchronous simply by wrapping the operation with Task.
Read more >
Chapter 6. File system: Synchronous and asynchronous ...
Synchronous methods are available for all the POSIX and bulk API calls. Some examples include readFileSync , statSync , and readdirSync . Sync...
Read more >
Asynchronous file access (C#) - Microsoft Learn
Learn how to use the async feature to access files in C#. You can call into asynchronous methods without using callbacks or splitting...
Read more >
Difference between synchronous and asynchronous method ...
1. Synchronous methods: Synchronous functions block the execution of the program until the file operation is performed. These functions are also ...
Read more >
FileSystemSyncAccessHandle contains async methods #7
All directory operations are already async, and I don't think anyone has proposed making them synchronous yet. Given that, opening a file will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found