8.0.2 • Published 6 months ago

@kikiutils/node v8.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@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.

consola

  • Console logger integration

crypto-hash

  • cryptoMd5, cryptoMd5ToBuffer
  • cryptoSha3224, cryptoSha3224ToBuffer
  • cryptoSha3256, cryptoSha3256ToBuffer
  • cryptoSha3384, cryptoSha3384ToBuffer
  • cryptoSha3512, cryptoSha3512ToBuffer

datetime

  • formatDate
  • getDateRangeFromDate
  • getMidnightDateFromToday

enum

  • getEnumStringValues
  • getEnumNumberValues

env

  • checkAndGetEnvValue

general

  • extractFirstValue

hash

  • sha3224
  • sha3256
  • sha3384
  • sha3512

math

  • toPercentageString

number

  • toCompactNumberString

pino

  • Pino logger integration

random

  • generateWithNestedRandomLength

string

  • randomString

License

MIT License

5.1.5

10 months ago

5.1.4

11 months ago

5.1.3

11 months ago

5.1.2

11 months ago

5.1.1

12 months ago

7.1.0

7 months ago

6.0.1

8 months ago

1.1.7

10 months ago

6.0.0

8 months ago

1.1.6

10 months ago

1.1.5

10 months ago

1.1.4

10 months ago

7.0.0

7 months ago

8.0.1

7 months ago

8.0.0

7 months ago

8.0.2

6 months ago

5.1.0

12 months ago

5.0.1

1 year ago

5.0.0

1 year ago

4.4.0

1 year ago

4.3.1

1 year ago

4.3.0

1 year ago

4.2.4

1 year ago

2.0.0

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

4.2.3

1 year ago

4.2.2

1 year ago

4.1.0

1 year ago

4.0.0

1 year ago

4.2.1

1 year ago

4.2.0

1 year ago

2.0.0-rc.4

1 year ago

2.0.0-rc.2

2 years ago

2.0.0-rc.3

2 years ago

2.0.0-rc.0

2 years ago

2.0.0-rc.1

2 years ago

2.0.0-alpha.3

2 years ago

2.0.0-alpha.2

2 years ago

2.0.0-alpha.0

2 years ago

2.0.0-alpha.1

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago