- Run
yarn install
on repo root
- Run
yarn start <...args>
on the repo root eg:yarn start hello world
- Run
yarn test
on the repo root
- Define a new class and extend it with
IOutputStrategy
- Override the
output()
function and write custom strategy code. Return the text that needs to be printed in the console. - Pass an instance of the new strategy as an array to the TextOutputter constructor,
eg: If your strategy was
LowerCaseOutput
, you can pass to TextOutputter as followsnew TextOutputter([new LowerCaseOutput()])
seeindex.js
insrc
folder for working example.