@eternl/tools
v0.10.18
Published
Shared tools package for log helpers, base utilities and bech32 helpers
Keywords
Readme
@eternl/tools
Shared utility package for logging and common data helpers.
Installation
npm install @eternl/toolsIncluded Modules
@eternl/tools/log- Structured console helpers:
el,sl,warn,error,json
- Structured console helpers:
@eternl/tools/lib/array- Array utilities
@eternl/tools/lib/bech32- Bech32 encode/decode helpers and shared
PREFIX_BECH32constants
- Bech32 encode/decode helpers and shared
@eternl/tools/lib/crc8- CRC-8 checksum helpers
@eternl/tools/lib/hex- Hex and byte conversion helpers
@eternl/tools/lib/id- ID utilities
@eternl/tools/lib/json- Safe JSON transform helpers
@eternl/tools/lib/math- Numeric helper functions
@eternl/tools/lib/number- Number formatting helpers
@eternl/tools/lib/sleep- Async timing helpers
@eternl/tools/lib/string- String utilities
@eternl/tools/lib/time- Time and timezone helpers
Usage
import { el, sl, json } from '@eternl/tools/log'
import { encodeBech32 } from '@eternl/tools/lib/bech32'
import { sleep } from '@eternl/tools/lib/sleep'
import { now } from '@eternl/tools/lib/time'
console.log(el('addressBookStore'), sl('loadAddressBook'), json({ ok: true }))
console.log(encodeBech32('pool', Buffer.from('ab'.repeat(28), 'hex')))
await sleep(50)
console.log(now())Exports
- Root export re-exports
@eternl/tools/logand the utility modules in@eternl/tools/lib/*. @eternl/tools/logexports:json,el,er,sl,warn,error.@eternl/tools/lib/*exports feature-specific utility functions by module.
License
Business Source License 1.1 (BUSL-1.1).
Additional Use Grant: None.
Commercial use requires a separate license from Tastenkunst.
Contact: https://tastenkunst.com/
