pseudo-random string generator with an indication of the alphabetical set and the percentage of the appearance of each element
$ node random-string.js stringLength inputfile.json"stringLength" - integer value - how result string is long...
"inputfile.json" must contain JSON like this:
[ { letter: 'a', chance: 0.2 },
{ letter: 'b', chance: 0.1 },
{ letter: 'c', chance: 0.5 },
{ letter: 'd', chance: 0.2 } ] $ node random-string.js 42 inputparams.json Output:
abcadcbcccabacddcdcaddacdaccccccdcccabdccc