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

3.0.3 • Public • Published

Common Utils

This package contains a number of utility classes used throughout the Snickerdoodle Labs ecosystem. They don't really have a common theme. Most are designed for IOC patterns, and are marked with Inversify decorators. Some, such as AjaxUtils and TimeUtils, mostly provide Neverthrow semantics for underlying library methods. ObjectUtils is a pure static class that provides a number of functional methods. Some are just utility classes that are designed to be new'd up and used in a normal OO way, such as TimedCache.

Concepts

Neverthrow

Neverthrow provides a way to do strong typing of errors in Typescript, in both synchronous and asynchronous methods. We do things almost entirely async and most every method returns ResultAsync<>. Some may view this as a digression since using ResultAsync looks a lot like old promise-based code; ResultAsync<> is incompatible with async/await mechanics in modern Javascript/Typescript. We view it as a trade off instead- ResultAsync<> allows for strongly typed errors, something that cannot be done with TS normally. We take the trade off of being able to say exactly what errors may be returned by a method over slick coding semantics.

Inversion of Control

We use Inversify to provide Inversion of Control, and most of our utilities include an interface and a type for use by Inversify, as well as being decorated for injection.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.3129latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.3129
3.0.23
2.0.4553
3.0.128
3.0.00
2.0.328
2.0.20
2.0.10
2.0.00
1.0.12525
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.23
1.0.10
1.0.00
0.2.00
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.130
0.0.120
0.0.110
0.0.100
0.1.00
0.0.91
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i @snickerdoodlelabs/common-utils

Weekly Downloads

1,254

Version

3.0.3

License

MIT

Unpacked Size

134 kB

Total Files

97

Last publish

Collaborators

  • edlgn2
  • oz_sdl
  • okanozdemir
  • cookies_baker
  • sdmuki
  • ldnovaksdl
  • muhammed0101
  • snickerchar
  • seansing
  • tthebc01