const chalk = require('chalk');
const hash = require('ansi-hash')();
function log(namespace, line) {
const color = chalk.ansi256(hash(namespace));
console.log(`[${color(namespace)}] ${line}`);
}
log('server1', 'Hello');
-
Notifications
You must be signed in to change notification settings - Fork 0
TooTallNate/ansi-hash
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Get an ANSI color code for a given string