A modular utility library for Node.js offering secure hashing, flexible logging, datetime manipulation, and more.
- 📜 Simple and flexible logging with Consola and Pino
- 🔒 Secure hash utilities: MD5, SHA3-224, SHA3-256, SHA3-384, SHA3-512
- 📅 Datetime utilities for formatting, ranges, and offsets
- 🔢 Enum helpers to extract values
- 🌱 Environment variable checker with error handling
- 📈 Math utilities like percentage formatting
- 💎 Number formatting utilities (e.g. compact representation)
- 🔤 String tools such as random string generation
- ⚙️ General-purpose utilities like value extractors
- 📦 Modular by design — import only what you need via
@kikiutils/node/<module>
-
Node.js
>= 18.12.1
Using pnpm:
pnpm add @kikiutils/node
You can also use yarn
, npm
, or bun
.
[!NOTE] This package is modular. It does not install all dependencies by default.
If a utility depends on a third-party package (e.g.
date-fns
), you must install it manually.
Import the functions or modules you want to use:
import { logger } from '@kikituils/node/consola';
import { extractFirstValue } from '@kikituils/node/general';
const data = [
0,
1
];
const value = extractFirstValue(data);
console.log(value); // 0
logger.info(value);
Each module file includes function-level comments and usage examples.
- Console logger integration
-
cryptoMd5
,cryptoMd5ToBuffer
-
cryptoSha3224
,cryptoSha3224ToBuffer
-
cryptoSha3256
,cryptoSha3256ToBuffer
-
cryptoSha3384
,cryptoSha3384ToBuffer
-
cryptoSha3512
,cryptoSha3512ToBuffer
formatDate
getDateRangeFromDate
getMidnightDateFromToday
getEnumStringValues
getEnumNumberValues
checkAndGetEnvValue
extractFirstValue
sha3224
sha3256
sha3384
sha3512
toPercentageString
toCompactNumberString
- Pino logger integration
generateWithNestedRandomLength
randomString