Goldies.js

A wide-ranging collection of JavaScript helpers

🌲

Tree-shakable

Import only what you need

🔄

Multiple formats

ESM, CommonJS, and UMD bundles

📦

Environment-aware

Browser and Node.js utilities

📊

Type-safe

Full TypeScript support

Installation

npm install goldies

Interactive Demo

Array Utilities

Click "Remove Duplicates" to see result

String Utilities

Click "Find Usernames" to see result

Format Utilities

Click "Format Bytes" to see result

Type Checking

Click "Validate URL" to see result

Usage Examples

Traditional namespace import

import goldies from 'goldies';

// Array utilities
const uniqueArray = goldies.array.dedupe([1, 2, 2, 3]);

// Object utilities
const cloned = goldies.object.clone({ name: 'John' });

// String utilities
const hasPrefix = goldies.string.startsWith('Hello world', 'Hello');

Tree-shakable direct imports (recommended)

// Only import what you need for smaller bundle size
import { dedupe } from 'goldies/array/dedupe';
import { clone } from 'goldies/object/clone';
import { startsWith } from 'goldies/string/startsWith';

const uniqueArray = dedupe([1, 2, 2, 3]);
const cloned = clone({ name: 'John' });
const hasPrefix = startsWith('Hello world', 'Hello');