Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const stringHash = require('string-hash');
- const chalk = require('chalk');
- const colors = 'red green blue cyan magenta yellow'.split(' ');
- module.exports = str => chalk[
- colors[stringHash(str) % colors.length]
- ](str);
Add Comment
Please, Sign In to add comment