@3dsource/utils
v1.0.31
Published
Shared utilities for 3dsource applications and libraries
Readme
@3dsource/utils
Shared color, math, geometry, CSV, image, string and RxJS utilities used by 3dsource applications and libraries.
Requirements
- Node.js 20 or newer
- RxJS
>=7.8.0 <8.0.0as a peer dependency
uuid and ts-md5 are implementation dependencies and are installed with the
package.
Installation
npm install @3dsource/utils rxjsImports
The package currently exposes one root entrypoint. Import public functions from
@3dsource/utils; subpath imports such as @3dsource/utils/color are not
published.
import { clampf, generateUuid, HEXtoRGB, RGBtoHEX } from '@3dsource/utils';
const rgb = HEXtoRGB('#ff0000');
const hex = RGBtoHEX(255, 0, 0);
const percentage = clampf(0, 100, 150);
const id = generateUuid();Public categories
The root entrypoint exports utilities from:
colorconstantscsvdevfilenaminggeomhelpersimageinterfacesmathmutexpredicatesrxjsstrings
Refer to src/public-api.ts and the generated declarations for the complete
public API.
Repository development
Run commands from the repository root:
pnpm utils:build
pnpm utils:release:patchThe release command performs verification, changes the package version and publishes the verified tarball to npm.
