@apextoaster/js-utils
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

JS Utils

This project is a collection of utilities, collected from my other Typescript projects, lightly documented and heavily tested.

Contents

Status

Pipeline status Lines of Code Test coverage MIT license FOSSA Status

Open bug count Open issue count Closed issue count

Renovate badge Dependency status Dev dependency status Known vulnerabilities

Maintainability score Technical debt ratio Quality issues Language grade: JavaScript Total alerts

Releases

github release link github release version github commits since release

npm package link npm release version Typescript definitions

Usage

Install:

yarn add -D @apextoaster/js-utils

And import:

import { mustExist } from '@apextoaster/js-utils';

The library is bundled and has no dependencies.

Features

Please see the complete API docs for the full function list.

Features utilities and helpers for:

  • Array
    • assertions/guards:
      • hasItems
      • isArray for both Array/ReadonlyArray
      • isEmpty
      • lengthOf
    • conversion
      • filterZip
      • toArray
  • Array Mapper
    • array-to-map converter, reduces an array of values to a map, using an array of keys
  • Async
    • timed promises
      • defer/deferValue
      • deferUntil
      • timeout
  • Buffer
    • concatenation
      • concat
      • encode
  • Checklist
    • allow/deny list
  • Child Process
    • childResult
    • writeInput
  • Env Vars
    • isDebug
  • Errors
    • nestable, typed error
      • ChildProcessError
      • InvalidArgumentError
      • MissingKeyError
      • NotFoundError
      • NotImplementedError
      • TimeoutError
  • Logger
    • test logging helpers
  • Map
    • types
      • MapLike
    • assertions/guards:
      • mustGet
    • null-safe helpers
      • getOrDefault
    • helpers for Map<K, Array<V>>
      • getHead/getHeadOrDefault
      • setOrPush
    • concat/merge
      • mergeMap
      • pushMergeMap
    • conversion
      • entriesOf
      • makeDict
      • makeMap
      • pairsToMap
  • Math
    • predicates for functional methods
      • sum
  • Maybe
    • types
      • Maybe
      • None
    • assertions/guards
      • doesExist
      • mustExist
      • mustDefault
      • mustFind
      • removeNone
    • null-safe helpers
      • isNone
      • isSome
  • Predicate
    • types for functional methods
  • Reflect
    • getConstructor
    • getMethods
  • Signal
    • wait for OS signal
      • signal
  • String
    • leftPad
    • trim with suffix

Readme

Keywords

none

Package Sidebar

Install

npm i @apextoaster/js-utils

Weekly Downloads

1

Version

0.5.0

License

MIT

Unpacked Size

528 kB

Total Files

282

Last publish

Collaborators

  • ssube
  • apexsvcs