js

A collection of 3 post

Child pages with getStaticPaths() in Astro

How to create a child page with : Full code 1. What is ? Here is the description of getStaticPaths(): Because Astro is a static site builder it needs to know how to generate all the paths that are found in the app, to do this you need to export a function 2. What to write in ? An array with…

Read a big file using NodeJS streams

Lets say that you have a file with 100.000 rows and you need to read it all. How should you proceed doing this task using a stream in . Create a file with 100.000 rows from linux command; Keep the path as it will get deleted if you somehow forget to delete the file. Solution Now let’s write our…

Using NodeJS streams

What is stream? A stream is a sequence of elements that become available over time. You can process chunks of a big file without loading the whole file at once into memory. In streams are a core feature and understanding them is a good way to make your life easier as a NodeJS developer. NodeJS…