Scott Penrose

NodeJS Sync

Scott is an expert software developer with over 30 years experience, specialising in education, automation and remote data.

Be aware of modules... You just don't know if they are using Sync calls.

Example today I found dir2html - https://github.com/mcantelon/node-dir2html. Seemed to do what I want, but I wondered how they were getting stat on each directory/file, and I found it was using readdirSync and statSync. This means my entire node server is locked if there is any delay on the IO (which so often there is).

Fortunately you can usually search for the words Sync in your libs. Check them... don't trust modules you use.

  • NodeJS