Tweakr v1.2 – Latest Release 🚀 Release Date: 2025-10-08
A modern, lightweight utility library for JavaScript/TypeScript. Provides functional, async, array, number, object, browser, and string helpers, fully typed, tree-shakable, and thoroughly tested.
npm install tweakr Copy
npm install tweakr
yarn add tweakr Copy
yarn add tweakr
pnpm add tweakr Copy
pnpm add tweakr
import { flatten, unique } from 'tweakr';console.log(flatten([1,[2,3]])); // [1,2,3]console.log(unique([1,2,2,3])); // [1,2,3] Copy
import { flatten, unique } from 'tweakr';console.log(flatten([1,[2,3]])); // [1,2,3]console.log(unique([1,2,2,3])); // [1,2,3]
const { flatten, debounce } = require('tweakr');console.log(flatten([1,[2,3]])); // [1,2,3] Copy
const { flatten, debounce } = require('tweakr');console.log(flatten([1,[2,3]])); // [1,2,3]
<script src="https://cdn.jsdelivr.net/npm/tweakr/dist/tweakr.min.js"></script><script> console.log(Tweakr.flatten([1,[2,3]]));</script> Copy
<script src="https://cdn.jsdelivr.net/npm/tweakr/dist/tweakr.min.js"></script><script> console.log(Tweakr.flatten([1,[2,3]]));</script>
v1.2.0 – 2025-10-08
v1.1.0 – 2025-10-06
v1.0.0 – 2025-10-06
chunk, compact, concat, difference, differenceBy, drop, dropRight, fill, flatten, flattenDeep, flattenDepth, head, initial, intersection, intersectionBy, join, shuffle, unique, union, unionBy, zip, zipWith, unzip, chunkWhile, removeIndex, take, takeRight, dropWhile, takeWhile, groupBy
debounceAsync, filterAsync, mapAsync, memoizeAsync, onceAsync, parallelLimit, queue, raceAll, reduceAsync, retry, retryBackoff, retryUntil, series, sleep, throttleAsync, timeout, waitFor, waterfall, withCancel, withTimeout, asyncCompose, asyncPipe
after, before, compose, curry, debounce, defer, delay, memoize, noop, once, partial, pipe, promisify, rateLimit, throttle, times, tryCatch, unary, wrap, yieldToNext, tap, wrapDeep, afterAsync, beforeAsync, curryN, composeN, pipeN, memoizeN, onceNAsync, noopAsync, identityAsync, retryAsync
camelCase, capitalize, containsIgnoreCase, endsWithIgnoreCase, escapeHtml, interpolate, isPalindrome, padLeft, padRight, pluralize, randomString, repeat, reverseString, reverseWordsAdvanced, singularize, startsWithIgnoreCase, stripAccents, stripHtml, stripWhitespace, slugify, titleCase, truncate, unescapeHtml, wordCount, endsWith, honorific, includes, removePrefix, removeSuffix, replaceAll, startsWith, trimAll, collapseWhitespace, ordinalSuffix, removeNumbers, truncateWords, replaceVowels, snakeToCamel, camelToKebab
clamp, decimalPlaces, factorial, fibonacci, isEven, isFiniteNumber, isInteger, isNegative, isOdd, isPositive, isPrime, lerp, max, min, random, round, sum, toDegrees, toFixedNumber, toPercentage, toRadians, randomInt, randomFloat, clampBigInt, factorialBigInt, isEvenBigInt
cloneDeep, deepEqual, deepMerge, entries, filterKeys, filterValues, get, invert, keys, mapValues, mapValuesDeep, mapKeysDeep, merge, mergeAll, omit, omitBy, omitDeep, pick, pickBy, pickDeep, set, unset, values, assignDeep, getOrDefault, has, invertBy
copyToClipboard, deleteCookie, downloadFile, focusElement, getCookie, getDeviceType, getQueryParam, getScrollPosition, getThemePreference, getUserLanguage, isInViewport, isOnline, onVisibilityChange, readFromClipboard, removeQueryParam, scrollToBottom, scrollToTop, setCookie, setFavicon, setQueryParam
debouncePromise, deepFreeze, identity, isEmpty, noopAsync, pipeAsync, uniqueId
Tweakr v1.2 – Latest Release 🚀 Release Date: 2025-10-08
A modern, lightweight utility library for JavaScript/TypeScript. Provides functional, async, array, number, object, browser, and string helpers, fully typed, tree-shakable, and thoroughly tested.
Installation
npm
yarn
pnpm
Usage
ESM / Tree-Shakable
CJS / Node.js
Browser Global (UMD)
Updates / Changelog
v1.2.0 – 2025-10-08
v1.1.0 – 2025-10-06
v1.0.0 – 2025-10-06
Key Features
Array
chunk, compact, concat, difference, differenceBy, drop, dropRight, fill, flatten, flattenDeep, flattenDepth, head, initial, intersection, intersectionBy, join, shuffle, unique, union, unionBy, zip, zipWith, unzip, chunkWhile, removeIndex, take, takeRight, dropWhile, takeWhile, groupBy
Async
debounceAsync, filterAsync, mapAsync, memoizeAsync, onceAsync, parallelLimit, queue, raceAll, reduceAsync, retry, retryBackoff, retryUntil, series, sleep, throttleAsync, timeout, waitFor, waterfall, withCancel, withTimeout, asyncCompose, asyncPipe
Function
after, before, compose, curry, debounce, defer, delay, memoize, noop, once, partial, pipe, promisify, rateLimit, throttle, times, tryCatch, unary, wrap, yieldToNext, tap, wrapDeep, afterAsync, beforeAsync, curryN, composeN, pipeN, memoizeN, onceNAsync, noopAsync, identityAsync, retryAsync
String
camelCase, capitalize, containsIgnoreCase, endsWithIgnoreCase, escapeHtml, interpolate, isPalindrome, padLeft, padRight, pluralize, randomString, repeat, reverseString, reverseWordsAdvanced, singularize, startsWithIgnoreCase, stripAccents, stripHtml, stripWhitespace, slugify, titleCase, truncate, unescapeHtml, wordCount, endsWith, honorific, includes, removePrefix, removeSuffix, replaceAll, startsWith, trimAll, collapseWhitespace, ordinalSuffix, removeNumbers, truncateWords, replaceVowels, snakeToCamel, camelToKebab
Number
clamp, decimalPlaces, factorial, fibonacci, isEven, isFiniteNumber, isInteger, isNegative, isOdd, isPositive, isPrime, lerp, max, min, random, round, sum, toDegrees, toFixedNumber, toPercentage, toRadians, randomInt, randomFloat, clampBigInt, factorialBigInt, isEvenBigInt
Object
cloneDeep, deepEqual, deepMerge, entries, filterKeys, filterValues, get, invert, keys, mapValues, mapValuesDeep, mapKeysDeep, merge, mergeAll, omit, omitBy, omitDeep, pick, pickBy, pickDeep, set, unset, values, assignDeep, getOrDefault, has, invertBy
Browser
copyToClipboard, deleteCookie, downloadFile, focusElement, getCookie, getDeviceType, getQueryParam, getScrollPosition, getThemePreference, getUserLanguage, isInViewport, isOnline, onVisibilityChange, readFromClipboard, removeQueryParam, scrollToBottom, scrollToTop, setCookie, setFavicon, setQueryParam
Utilities
debouncePromise, deepFreeze, identity, isEmpty, noopAsync, pipeAsync, uniqueId
Methods