With our RDF parsing module in place and well tested, let’s turn our attention to getting all those thousands of records into the database.
But one word of caution before we proceed: the code in this section attempts to demonstrate performance-related problems and their solutions. The speed of your hardware and the settings of your operating system may make it easier or harder to see these effects.
Alright—to crawl the cache directory, we’ll use a module called file, which is available through npm. Install and save it as usual, and we’ll begin:
$ npm install --save file
The file module has a convenient method called walk() that traverses a directory tree and calls a callback for each file it finds.