REJOINDER
rejoinder
/rɪˈdʒɔɪndə/
noun
a reply or response to a question or remark, esp a quick witty one; retort
Rejoinder is that generator of smart, pretty, highly organized output your
parents warned you about.
TODO: SPIN OFF EXECUTABLE POWERS INTO A SLASH-FILE VERSION i.e.
rejoinder/execute
Super awesome when paired with
inquirer and/or
commander!
Installation
npm install rejoinder
If you want support from shelljs (required to use Execute
), install that too:
npm install shelljs
Usage and Examples
const rejoinder = require('rejoinder');
let echo = rejoinder.echo;
let execute = rejoinder.execute;
echo.now('output this very important warning to the console with pretty colors');
echo.withPostfix.warn('output this very important warning to the console with pretty colors');
echo.beVerbose = true;
echo.ifVerbose('Some message will appear if beVerbose is true');
echo.ifDebug('Some debug message will appear if beVerbose is true prefixed with the string "DEBUG "');
echo.beVerbose = false;
echo.ifVerbose('Some message will NOT appear if beVerbose is false!');
echo.ifDebug('Some debug message will NOT appear if beVerbose is false!');
echo.if(somethingistrue, 'I spit only the truth!');
echo.now('all', 'my', 'methods', 'are', 'also', 'variadic!');
echo.if(true, 'even', 'this', 'one :)');
echo.prefix = '>>';
echo.now('changed', 'the', 'game!');
echo.prefix = 'Big:Boy:Time:';
echo.messageSeparator = '||';
echo.usingPredicate((str) => `"${str}"`, 'the', 'time', 'for', 'fun and games is', 'over!');
echo.withPostfix('postfix', 'this is', 'pretty cool');
echo.postfixSeparator = '<>';
echo.withPostfix('postfix', 'this too');
echo.withPostfix.ok('GOT IT!');
echo.withPrefix('~>', () =>
{
echo.now('or');
echo.now('is', 'it? I wonder.');
echo.withPostfix('NO', 'Wait!');
echo.withPostfix.action("Don't make me bring Execute into this...");
});
echo.beVerbose = true;
execute.now('return 0');
Documentation
See API.md
Tests
npm install
npm test
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.
Release History
- 0.3.x Several bugfixes
- 0.2.0 Initial working release; unit tested; semver versioning semantics are
obeyed from this point forward
- 0.1.x Rapid iteration