Feature | fs.createWriteStream(path).write(buffer) | fs.writeFileSync(path, buffer) |
---|---|---|
Synchronicity | Asynchronous | Synchronous |
Blocking | Non-blocking | Blocking |
Performance | Better for large files or frequent writes | Better for small, infrequent writes |
Memory Usage | More memory-efficient for large files | Loads entire content into memory |
Error Handling | Requires callback or event listeners | Throws errors directly |
Use Case | Streaming large files, real-time data | Quick, simple writes, small files |
Control Flow | Continues execution immediately | Waits until write is complete |
Backpressure Handling | Handles backpressure autom |
Feature | fs.createWriteStream(path).write(buffer) | fs.writeFileSync(path, buffer) |
---|---|---|
Synchronicity | Asynchronous | Synchronous |
Blocking | Non-blocking | Blocking |
Performance | Better for large files or frequent writes | Better for small, infrequent writes |
Memory Usage | More memory-efficient for large files | Loads entire content into memory |
Error Handling | Requires callback or event listeners | Throws errors directly |
Use Case | Streaming large files, real-time data | Quick, simple writes, small files |
Control Flow | Continues execution immediately | Waits until write is complete |
Backpressure Handling | Handles backpressure autom |
Feature | fs.createWriteStream(path).write(buffer) | fs.writeFileSync(path, buffer) |
---|---|---|
Synchronicity | Asynchronous | Synchronous |
Blocking | Non-blocking | Blocking |
Performance | Better for large files or frequent writes | Better for small, infrequent writes |
Memory Usage | More memory-efficient for large files | Loads entire content into memory |
Error Handling | Requires callback or event listeners | Throws errors directly |
Use Case | Streaming large files, real-time data | Quick, simple writes, small files |
Control Flow | Continues execution immediately | Waits until write is complete |
Backpressure Handling | Handles backpressure autom |
January 3, 2022
Editors:
To me, legacy code is simply code without tests. I’ve gotten some grief for this definition. What do tests have to do with whether code is bad? To me, the answer is straightforward, and it is a point that I elaborate throughout the book: Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.
Four Reasons to Change Software: For simplicity’s sake, let’s look at four primary reasons to change software.
This example converts a MD image to a Next JS Image. HEIGHT and WIDTH need to be replaced manually.
Text to replace

Regex to use in the Search field. Group 1 is the title
, and group 2 is the src
.
!\[(.*)\]\(/public(.*)\)
To set up a domain alias you should already have a primary domain. Other than that, two other things are needed:
- Another domain
- A DNS provider
Will assume that you already have "another domain" therefore the piece missing is the DNS provider. The best option for this is to use netlify itself (https://app.netlify.com/dns). Just add the new domain and point it to your app name.
Set up you alias in advance or it won't be included in the SSL certificate generation. Visit the following site for more info https://docs.netlify.com/domains-https/https-ssl/#domain-aliases.
<div id="errors" style=" | |
background: #c00; | |
color: #fff; | |
display: none; | |
margin: -20px -20px 20px; | |
padding: 20px; | |
white-space: pre-wrap; | |
"></div> | |
<div id="root"></div> | |
<script> |