# dallmo-util

> add logger

Latest version **0.1.6** (published 2022-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install dallmo-util
pnpm add dallmo-util
yarn add dallmo-util
bun add dallmo-util
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2022-11-07 |
| First published | 2022-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | npm@dallmo.com |
| Maintainers | dallmo |

## Links

- npm: https://www.npmjs.com/package/dallmo-util
- Repository: https://gitlab.com/dallmo.com/npm/dallmo-util/
- npm.io page: https://npm.io/package/dallmo-util

## Dependencies (6)

- [winston](https://npm.io/package/winston.md) ^3.8.2
- [random-words](https://npm.io/package/random-words.md) ^1.2.0
- [winston-cloudwatch](https://npm.io/package/winston-cloudwatch.md) ^6.1.1
- [winston-aws-cloudwatch](https://npm.io/package/winston-aws-cloudwatch.md) ^3.0.0
- [winston-daily-rotate-file](https://npm.io/package/winston-daily-rotate-file.md) ^4.7.1
- [@aws-sdk/client-cloudwatch-logs](https://npm.io/package/@aws-sdk/client-cloudwatch-logs.md) ^3.171.0

## Recent versions

- 0.1.6 (latest) — 2022-11-07
- 0.1.5 — 2022-09-15
- 0.1.4 — 2022-09-15
- 0.1.3 — 2022-08-29
- 0.1.2 — 2022-08-17
- 0.1.1 — 2022-08-12

## README

# dallmo-util

- just some simple utils to be reused in other packages / codes ; 
- compatible with both cjs and esm, by following [the advice of a post by Dan Fabulich][ref-1] ;

[ref-1]: https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1

# usage

require / import the subpackage directly, then call the method comes with that object.

## subpackage list and methods ( alias )

- array_util
  - random_item
  - random_index
  - random_insert
  - insert_item
  - update_item
  - add_all ( sum )
  - tester

- math_util
  - add_leading_zero
  - random_integer ( random_int )
  - random_sections ( random_sec )
  - tester

- date_util
  - year ( YYYY )
  - month ( MM )
  - day ( DD )
  - hour ( hours, HH )
  - minute ( minutes, mm, min )
  - second ( seconds, ss, sec )
  - timestamp
  - tester

- string_util
  - head
  - tail
  - random_ending
  - random_words
  - sentence_type
  - sentence_type_1
  - sentence_type_2
  - random_sentence
  - random_sentence_type
  - random_sentence_type_1
  - random_sentence_type_2
  - words_array_to_sentence_type_2
  - capitalize
  - cap
  - tester

## cjs

to use the method, e.g., `random_item` in `array_util` : 

```
const array_util = require("dallmo-util/array");
```

## esm

```
import {array_util} from 'dallmo-util/array';
```

then, in either case, use the method with :

```
const result_item = array_util.random_item( some_array );
```

---
_Source: https://npm.io/package/dallmo-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
