The first step toward making use of Immutable.js collections in Node.js applications is reading data into them. You can read and parse CSV data into lists of maps, for example. When you start to read large amounts of data, things become trickier because things happen asynchronously.
Reading data into collections
Reading and parsing CSV data
Let's say that you have the following CSV data that you want to parse and use in an Immutable.js collection:
one,1,two,2,three,3
four,4,five,5,six,6
seven,7,eight,8,nine,9
Each row is a map that you want to insert into a list. Luckily, the format of each of these rows is already something that you can pass to Map.of(). You just need to parse it. To help with this, we'll use the...