This package has been deprecated

Author message:

Deprecated. Please use @kikiutils/shared instead.

@kikiutils/node

8.0.2 • Public • Published

@kikiutils/node

npm version npm downloads codecov License

A modular utility library for Node.js offering secure hashing, flexible logging, datetime manipulation, and more.

Features

  • 📜 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>

Requirements

  • Node.js >= 18.12.1

Installation

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.

Usage

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);

Modules & Functions

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

License

MIT License

Package Sidebar

Install

npm i @kikiutils/node

Weekly Downloads

43

Version

8.0.2

License

MIT

Unpacked Size

150 kB

Total Files

87

Last publish

Collaborators

  • kiki-kanri