# @snickerdoodlelabs/common-utils

> Common utils classes used in snickerdoodlelabs projects

Latest version **3.0.3** (published 2024-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @snickerdoodlelabs/common-utils
pnpm add @snickerdoodlelabs/common-utils
yarn add @snickerdoodlelabs/common-utils
bun add @snickerdoodlelabs/common-utils
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2024-04-30 |
| First published | 2022-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 130.8 KB |
| Known vulnerabilities | 0 (+25 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Muhammed Altinci <muhammed@snickerdoodlelabs.io> |
| Maintainers | edlgn2, oz_sdl, okanozdemir, cookies_baker, sdmuki, ldnovaksdl, muhammed0101, snickerchar, seansing, tthebc01 |
| Keywords | Encryption, Snickerdoodle, Crypto |

## Links

- npm: https://www.npmjs.com/package/@snickerdoodlelabs/common-utils
- Repository: https://github.com/SnickerdoodleLabs/protocol
- Homepage: https://github.com/SnickerdoodleLabs/protocol/tree/master/packages/objects#readme
- Issues: https://github.com/SnickerdoodleLabs/protocol/issues
- npm.io page: https://npm.io/package/@snickerdoodlelabs/common-utils

## Dependencies (10)

- [pino](https://npm.io/package/pino.md) ^8.1.0
- [uuid](https://npm.io/package/uuid.md) ^8.3.0
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [ethers](https://npm.io/package/ethers.md) ^6.10.0
- [inversify](https://npm.io/package/inversify.md) ^6.0.2
- [tweetnacl](https://npm.io/package/tweetnacl.md) ^1.0.3
- [neverthrow](https://npm.io/package/neverthrow.md) ^5.1.0
- [oauth-1.0a](https://npm.io/package/oauth-1.0a.md) ^2.2.6
- [neverthrow-result-utils](https://npm.io/package/neverthrow-result-utils.md) ^2.0.2
- [@snickerdoodlelabs/objects](https://npm.io/package/@snickerdoodlelabs/objects.md) ^3.0.9

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2024-04-30
- 3.0.2 — 2024-04-10
- 2.0.4 — 2024-03-27
- 3.0.1 — 2024-03-22
- 3.0.0 — 2024-03-22
- 2.0.3 — 2024-02-26
- 2.0.2 — 2024-02-13
- 2.0.1 — 2024-02-13
- 2.0.0 — 2024-02-09
- 1.0.12 — 2024-02-07
- 1.0.11 — 2024-02-07
- 1.0.10 — 2024-02-07
- 1.0.9 — 2023-12-06
- 1.0.8 — 2023-11-29
- 1.0.7 — 2023-11-15
- … 33 more at https://npm.io/package/@snickerdoodlelabs/common-utils/versions

## README

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

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