1
0
Fork 0
Go to file
renovate[bot] 8f1e7358a7
update: update dependency @types/lodash to v4.14.153 (#58)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-29 08:09:10 -05:00
.github fix(docs): comment header in PR template 2020-03-02 18:48:34 -06:00
config fix: remove mock-fs from vendor bundle 2020-05-20 08:12:09 -05:00
docs/api feat(list): add utils from salty-dog 2020-03-31 18:47:44 -05:00
scripts feat(build): add alpine image job from salty-dog 2019-11-09 20:17:20 -06:00
src feat(list): add utils from salty-dog 2020-03-31 18:47:44 -05:00
test feat(list): add utils from salty-dog 2020-03-31 18:47:44 -05:00
vendor/rollup-resources fix: declare resource modules 2019-09-28 10:42:41 -05:00
.codeclimate.yml feat(build): replace tslint with eslint 2019-11-09 16:50:30 -06:00
.dockerignore fix(build): add yarn lock to image before installing, add tmp files to docker ignore 2019-09-17 19:05:46 -05:00
.gitignore fix(build): omit git from package, ignore pid files 2019-11-10 09:47:10 -06:00
.gitlab-ci.yml remove(build): image jobs 2020-03-30 08:49:44 -05:00
.npmignore fix(build): omit git from package, ignore pid files 2019-11-10 09:47:10 -06:00
.npmrc feat(config): configure npm to use nexus mirror 2019-09-17 08:18:09 -05:00
CHANGELOG.md chore(release): 0.1.8 2020-05-20 08:13:27 -05:00
Dockerfile.alpine feat(build): add alpine image job from salty-dog 2019-11-09 20:17:20 -06:00
Dockerfile.stretch feat(build): add alpine image job from salty-dog 2019-11-09 20:17:20 -06:00
LICENSE.md feat: copy template from other projects 2019-09-17 07:45:15 -05:00
Makefile feat(build): add node shebang to index 2019-11-09 22:41:40 -06:00
README.md fix(docs): write a basic readme 2020-03-31 18:08:39 -05:00
package.json update: update dependency @types/lodash to v4.14.153 (#58) 2020-05-29 08:09:10 -05:00
renovate.json feat: copy template from other projects 2019-09-17 07:45:15 -05:00
run.mk feat: include additional makefiles, add example 2019-09-28 15:24:51 -05:00
tsconfig.json feat: copy template from other projects 2019-09-17 07:45:15 -05:00
yarn.lock update: update dependency @types/lodash to v4.14.153 (#58) 2020-05-29 08:09:10 -05:00

README.md

JS Utils

This project is a collection of utilities meant to extend lodash, 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 depends on lodash, linked in a vendor module.

Features

  • array mapper
    • map elements to keys by order
    • skip initial, gather remaining
  • async
    • defer
    • promise timeout
    • wait for predicate
  • async tracker
    • track and log leaking async resources for tests
  • buffer
  • checklist
    • include/exclude mode (whitelist/blacklist)
  • child process
    • wait for exit and gather output
    • write and flush
  • env
    • check DEBUG
  • list
    • concat lists
  • logger
    • get test logger (null or console depending on DEBUG)
  • map
    • must get (assertion)
    • get or default
    • get head from list value
    • get head or default
    • set or push to key
    • merge maps
    • push-merge maps
    • convert dict to map and vice versa
    • normalize map values to lists
    • create map from name-value pairs
  • maybe
    • is nil test (negative nil test)
    • count array or maybe
    • filter nil from list
    • must find (assertion)
    • does exist (positive nil test)
    • must exist (assertion)
    • must default (assertion)
  • pid file
    • write pid file
    • delete pid file
  • reflect
    • get constructor name
    • get methods from prototype chain
  • signals
    • wait for OS signal
  • string
    • left pad (please don't import just for this)
    • trim with suffix