changelog
Version:
Command line tool (and Node module) that generates a changelog in color output, markdown, or json for modules in npmjs.org's registry as well as any public github.com repo.
19 lines (12 loc) • 415 B
JavaScript
;
var indent = 4;
var wordwrap = require('wordwrap');
function bullet(string, bulletCharacter, noWrap) {
function wrap(str) {
var columns = !noWrap && process.stdout.columns || 100000;
return wordwrap(indent, columns)(str).trim();
}
string = string.replace(/(\r?\n)+/g, '\n');
return ' ' + (bulletCharacter || '*') + ' ' + wrap(string);
}
module.exports = bullet;