Skip to content

afeiship/kiv

Repository files navigation

kiv

Key includes value.

version license size download

installation

npm install @jswork/kiv

usage

import kiv from '@jswork/kiv';

const str2icon = {
  '@beta': '🍏',
  '@production': '🍎',
  '@upload': '🚚',
  '@cache': '📦',
};


kiv('Current msg is __@beta__.', str2icon); // Current msg is 🍏.
kiv('Current msg is __@production__.', str2icon); // Current msg is 🍎.
kiv('Current msg is __@upload__.', str2icon); // Current msg is 🚚.
kiv('Current msg is __@cache__.', str2icon); // Current msg is 📦.
kiv('Current msg is __@unknown__.', str2icon); // Current msg is ''.
kiv('Current msg is __@unknown__.', str2icon, '🍌'); // Current msg is 🍌.

license

Code released under the MIT license.