- brew https://brew.sh
- npm
brew install npm
- packages
npm install
npm start
Parameters
[fileName] [max length of lines]
The approach taken to wrap words consisted of the following steps.
- read each line from the text file and store it in an array
- for each paragraph in the array, break it down to a single line
- now that an array exist of either only a single line or an empty line, iterate through each line breaking the line up into chunks of MaxLength defined in the input
- for each chunk, save it into a new output document array
- print new formatted document
npm test