This script takes in a source CSV file containing message board post data and outputs three different files:
top_posts.csv
- Post Ids of public posts with more than10
comments and9000
views that are less than40
characters longother_posts.csv
- Post Ids of all posts not meeting the above criteriadaily_top_posts.csv
- Top post per day on the basis oflikes
Run node .
in this directory to run the script. An output
folder will be created containing the new files.
- Add the
--output-json
flag to store the output in JSON format (instead of the default CSV format) - Add the
--detailed
flag to store the entire post body fortop_posts
andother_posts
(instead of just the post Ids)
node . --output-json --detailed
Unit tests are written in Jest and can be tested with npm test
. While the code itself contains no external dependencies, unless you have Jest globally installed, you will need to run npm i
first to install jest.